Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Reading RGB jp2 image results in Red and Blue channels reversed

I'm using OpenCV 3.1.0 I'm calling it from Java.

When I read a jp2 file that was created using ImageIO I get an image with the red and blue channels reversed. When I open it using ImageIO ( https://github.com/jai-imageio/jai-imageio-jpeg2000 ), it's fine. Is the opencv codec that loads the jp2 simply assuming the pixels are packed BGR rather than checking the relevant metadata?

I can fix this on a case by case basis by rewriting all of the images in memory before I do anything with them but this seems like a bug and I'd need to do it on an ad-hoc basis.

Thanks Jim