Some Android devices have small memory sizes, or implement very stringent memory usage policies.
For my Android image processing application, there are two JPEG-specific image decoding options that are available from libjpeg, which I would like to use through OpenCV's highgui module.
- To find out the size and pixel format of the JPEG file, without loading the pixels into memory.
- To decode the JPEG file with a power-of-two scale down factor, such that it is not necessary to allocate a matrix at the original dimensions. Instead, the matrix only needs to be allocated at the scaled-down dimensions.
My question is:
- Does OpenCV support, or have plans to support such functionality?
- Has anyone done this with OpenCV before?
I can program to libjpeg directly. I find the libjpeg static library in the OpenCV4Android package at "sdk/native/3rdparty/libs/arch". However, there is no corresponding header file of the libjpeg inside the OpenCV4Android package.
Linking to a second copy of libjpeg from my code is not an option due to multiple definitions.