Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How should I read MPO Multi-jpeg files?

I have a 3D digital camera that produces image pairs in the .mpo file format. Each file contains essentially a pair of standard jpeg images, one after another. I know I can manually convert these into separate jpeg files, but that would be cumbersome for large numbers of images.

Since OpenCV contains jpeg-reading code, can anyone suggest a reasonable c++ approach for reading an MPO file and producing two cv::Mat objects?

How should I read MPO Multi-jpeg files?

I have a 3D digital camera that produces image pairs in the .mpo file format. Each file contains essentially a pair of standard jpeg images, one after another. I know I can manually convert these into separate jpeg files, but that would be cumbersome for large numbers of images.

Since OpenCV contains jpeg-reading code, can anyone suggest a reasonable c++ approach for reading an MPO file and producing two cv::Mat objects?

I've stepped into the imread code and I see that an fopen happens in the private _imread function in loadsave.cpp. That function uses an ImageDecoder object that happens to be a JpegDecoder in my instance.

It looks like I should design to the IJG API or else rely on the ImageDecoder interface which I assume may change in future versions of OpenCV. Is this correct?