Skip to content

SwapColorChannels + svlImageIO::write/read fail to swap color channels. #3

Open
@marcinbalicki

Description

@marcinbalicki

The following code snippet produces an incorrectly colored saved image (e.g., all blue). It should swap color channel R and B.

    std::string inputFile("testFile.bmp");
    std::string outputFile("outFile.bmp");

    svlSampleImageRGB           inputImage;
    svlSampleImageRGB           outputImage;

    int result = 0;
    result = svlImageIO::Read(inputImage, 0, inputFile, false);
    outputImage.SetSize(inputImage);

    // the following does not work when original image is bmp on mac.
    result = svlImageProcessing::SwapColorChannels(&inputImage, 0, &outputImage, 0);

    result = svlImageIO::Write(outputImage, 0, outputFile);

The input is a colored bmp file on mac OSX 10.9, cisst is compiled with opencv support.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions