imgproc: cvtColor: remove to copy edge pixels for COLOR_Bayer*_VNGs.#27226
imgproc: cvtColor: remove to copy edge pixels for COLOR_Bayer*_VNGs.#27226asmorkalov merged 3 commits intoopencv:4.xfrom
Conversation
|
The effect of this patch can be seen in these images. https://github.com/opencv/opencv_extra/pull/1249/files These pixels on the left/top/right/bottom edges will not be copied from inner pixels. |
|
I think this test result is false-positive on this pull request. CI tests the amount of changing files. If >1MiB, there is warning. |
|
I found a bug in the workaround for small sizes. I fixed it. When inputted image size is too small(<8), it works with interpolate mode. But it had not been cared for *VNG codes, so all behaviour are same even if convert codes are changed. |
|
@Kumataro Thanks a lot for the contribution! The test image with random noise shows the fix very well. Please ignore the warning on the patch size in extra. |
|
The PR was discussed on the Core team meeting. We decided to merge the PR to fix functional part with further optimization plan. copyMakeBorder is not efficient solution and we want to get rid of it in long term: #27256 |
imgproc: cvtColor: remove to copy edge pixels for COLOR_Bayer*_VNGs. opencv#27226 Close opencv#27225 Close opencv#5089 Related opencv/opencv_extra#1249 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
|
Thank you very much for considering this matter !! The reasons for choosing this fix provided here for your information : The current implementation assumes an offset of (2,2). And there are many magic number opencv/modules/imgproc/src/demosaicing.cpp Lines 1178 to 1190 in 19c4d97 And If the offset is removed, it requires to split the processing into a central part that can be implemented using SIMD, and other parts that can be wrapping edge without SIMD. However, it is very difficult to refactor for it. I prioritized removing the copies on the edges. |
Close #27225
Close #5089
Related opencv/opencv_extra#1249
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.