CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
imgcodecs: Add rgb flag for imread and imdecode #25809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I propose to extend existing perf tests with RGB case. Just to be sure that the new mode does not introduce significant degradation. |
img = imread(root + "readwrite/color_palette_alpha.png", IMREAD_COLOR_RGB); | ||
ASSERT_FALSE(img.empty()); | ||
ASSERT_TRUE(img.channels() == 3); | ||
|
||
// pixel is red in RGB | ||
EXPECT_EQ(img.at<Vec3b>(0, 0), Vec3b(255, 0, 0)); | ||
EXPECT_EQ(img.at<Vec3b>(0, 1), Vec3b(255, 0, 0)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to add test with RGBA output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @asmorkalov. For consistency, IMREAD_COLOR_RGB
currently converts all RGBA to RGB instead of RGBA output.
Perf results for system wide (Ubuntu 16.04) and own (from 3rdparty) on Jetson-tk1 (ARMv7+NEON):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Restrict opencv version to below 4.11 to keep api stable after opencv/opencv#25809
* syncing util/mask_tools.py * syncing util/image.py * keeping exif unconditionally * syncing components/media.py * syncing components/importer.py * syncing util/meta_file_util.py * moving cli/contexts/project/diff.py to cli/util/compare.py * moving Registry and PluginRegistry to components/registry.py * syncing components/exporter.py * syncing components/hl_ops.py * syncing components/dataset.py * limiting opencv version (due to opencv/opencv#25809) * fixes * upper case extension fix * fixes * always keeping exif info * limiting opencv version * Update src/datumaro/components/media.py Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * test for reading exif orientation * changelog entry * fixed isort * fixed test * fixed changelog * Update src/datumaro/components/hl_ops/__init__.py Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * fixing filter examples * hl_ops tests * syncing plugins/data_formats/celeba * syncing plugins/data_formats/cifar.py * setting DETECT_CONFIDENCE for yolo formats * syncing plugins/data_formats/image_dir.py * better detection for yolo classification importer * syncing plugins/data_formats/imagenet.py and plugins/data_formats/imagenet_txt.py * syncing plugins/data_formats/camvid.py * syncing tests/integration/cli/test_detect_format.py * syncing cli/util/project.py * syncing tests/integration/cli/test_filter.py * syncing tests/integration/cli/test_transform.py * yolo streaming exporter * syncing plugins/data_formats/coco * Update src/datumaro/components/media.py Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * Update src/datumaro/components/media.py Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * Update src/datumaro/components/media.py Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * Update tests/unit/test_video.py Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * Update src/datumaro/components/registry.py Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * coco find_images_dir do not fail if images folder doe not exist - because cvat needs to be able to export and then import dataset without images * coco find_rootpath do not fail if path does not end with ANNOTATIONS_DIR - because cvat needs it * fixes * fix linters * tests for HLOps.compare * syncing tests/unit/test_image.py * accounting for the new flag in cv2 * syncing components/importer.py * fixes * fixes * fixes * fixes * tests in test_masks.py from upstream * a bit of info on ImageColorChannel.UNCHANGED * fixing wrong merge * removing bad changes * rolling back changes in test * do not recollect subset names in StreamDatasetStorage if transformations do not change subsets * fixes * Refactor with_subset_dirs * Support detect() calls with no return value * Update importer detection confidence * Lower the default confidence * Align default format detection confidence in detector and importer * Clean imports * syncing tests/conftest.py and tests/unit/data_formats/conftest.py * syncing imagenet tests * test new yolo classification detetection behaviour * syncing tests/unit/test_format_detection.py * Apply suggestions from code review Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * fixes * fixes * Apply suggestions from code review Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com> * small fixes * basic streaming tests for coco and yolo formats * returning previous tests and behaviour for coco * Improve function name * raising error on unknown image id * test coco streaming * test yolo streaming --------- Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com>
Try to
imread
images by RGB to save R-B swapping costs.How to use it?
TODO
Performance test
Test with image_test.zip
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.