-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Open
Labels
Milestone
Description
System information (version)
- OpenCV => 4.5.5
- Operating System / Platform => Ubuntu 20.04
- Compiler => g++
Detailed description
I have the following constraints when I open images:
- Handling exif orientation
- Possibly convert myself from BGRA to BGR because of Inconsistant conversion from BGRA to BGR on png image #21694
I cannot use IMREAD_UNCHANGED because it will ignore the exif orientation. So I thought IMREAD_ANYCOLOR was exactly what I wanted, but it seem to have the same behavior than IMREAD_COLOR as it returns a BGRA image directly in BGR format.
The documentation is not so clear, but I expected it to respect the number of channel of the initial file, converting it to 8U (if not associated with IMREAD_ANYDEPTH) and applying the exif orientation.
If I wrongly interpreted IMREAD_ANYCOLOR, maybe another IMREAD flag is missing for my use case, or a way to apply the exif orientation afterward can be useful (just like PIL does).
Steps to reproduce
import cv2
img = cv2.imread(path, cv2.IMREAD_ANYCOLOR)
print(img.shape)
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found any solution - I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files: videos, images, onnx, etc
Reactions are currently unavailable
