-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
cv::imread/imdecode cannot load JPEG2000 codestream #19083
Copy link
Copy link
Closed
Description
System information (version)
- OpenCV => 4.4
- Operating System / Platform => MacOS Big Sur
- Compiler => Clang 12
Detailed description
The JPEG2000 standard defines both a "codestream" format and a file format for JP2K data. A codestream should ideally always be wrapped in the file format container, but in practice raw codestreams are sometimes found in the wild.
The OpenCV integration of OpenJPEG can read the JP2K file format, but not raw codestreams (also checked today's master). OpenJPEG itself has no problem reading codestreams (tested with the opj_decompress tool).
A codestream can be identified by its 4-byte header FF 4F FF 51.
OpenCV's JP2K file signature check should test for both the file header and the codestream header.
Steps to reproduce
Call cv::imread on the attached file.
balloon.j2c.zip
Reactions are currently unavailable