Keep inliers for linear remap with BORDER_TRANSPARENT#23754
Merged
asmorkalov merged 3 commits intoopencv:4.xfrom Jun 16, 2023
Merged
Keep inliers for linear remap with BORDER_TRANSPARENT#23754asmorkalov merged 3 commits intoopencv:4.xfrom
asmorkalov merged 3 commits intoopencv:4.xfrom
Conversation
modules/imgproc/src/imgwarp.cpp
Outdated
| if( borderType == BORDER_TRANSPARENT && cn != 3 ) | ||
| { | ||
| int sx = XY[dx*2], sy = XY[dx*2+1]; | ||
| if ((unsigned)sx == width1 || (unsigned)sy == height1) |
Contributor
There was a problem hiding this comment.
BTW, we have strange code above:
#if CV_SIMD128
if( _src.type() == CV_8UC3 )
width1 = std::max(ssize.width-2, 0);
#endif
Why do we guard processing of common variables in SIMD mode only?
/cc @vpisarev That commit is very old: https://github.com/opencv/opencv/blame/fdd83e5027cab3dcbc6acb321ca9c294b90f17e1/modules/imgproc/src/imgwarp.cpp#L663
Code condition is strange too: borderType == BORDER_TRANSPARENT && cn != 3. Why is cn used here?
Member
Author
There was a problem hiding this comment.
Code condition is strange too: borderType == BORDER_TRANSPARENT && cn != 3. Why is cn used here?
Removed that limitation and modified test correspondingly
4 tasks
vpisarev
approved these changes
Jun 16, 2023
vrabaud
added a commit
to vrabaud/opencv
that referenced
this pull request
Jul 4, 2023
I believe this is a proper fix to opencv#23562 The PR opencv#23754 overwrites data while that should not be the case with transparent data. The original test is failing because points at the border do not get computed because they do not have 4 neighbors to be computed. Still ,we can approximate their computation with whatever neighbors that are available.
6 tasks
vrabaud
added a commit
to vrabaud/opencv
that referenced
this pull request
Jul 10, 2023
I believe this is a proper fix to opencv#23562 The PR opencv#23754 overwrites data while that should not be the case with transparent data. The original test is failing because points at the border do not get computed because they do not have 4 neighbors to be computed. Still ,we can approximate their computation with whatever neighbors that are available.
asmorkalov
pushed a commit
that referenced
this pull request
Jul 12, 2023
Fix imgwarp at borders when transparent. #23922 I believe this is a proper fix to #23562 The PR #23754 overwrites data while that should not be the case with transparent data. The original test is failing because points at the border do not get computed because they do not have 4 neighbors to be computed. Still ,we can approximate their computation with whatever neighbors that are available. ### 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. - [x] The feature is well documented and sample code can be built with the project CMake
Merged
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
Jan 4, 2024
Keep inliers for linear remap with BORDER_TRANSPARENT opencv#23754 Address opencv#23562 ### Pull Request Readiness Checklist resolves opencv#23562 I do think that this is a bug because with `INTER_CUBIC + BORDER_TRANSPARENT` the last column and row are preserved. So same should be done for `INTER_LINEAR` 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. - [x] The feature is well documented and sample code can be built with the project CMake
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
Jan 4, 2024
Fix imgwarp at borders when transparent. opencv#23922 I believe this is a proper fix to opencv#23562 The PR opencv#23754 overwrites data while that should not be the case with transparent data. The original test is failing because points at the border do not get computed because they do not have 4 neighbors to be computed. Still ,we can approximate their computation with whatever neighbors that are available. ### 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. - [x] The feature is well documented and sample code can be built with the project CMake
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
May 29, 2024
Keep inliers for linear remap with BORDER_TRANSPARENT opencv#23754 Address opencv#23562 ### Pull Request Readiness Checklist resolves opencv#23562 I do think that this is a bug because with `INTER_CUBIC + BORDER_TRANSPARENT` the last column and row are preserved. So same should be done for `INTER_LINEAR` 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. - [x] The feature is well documented and sample code can be built with the project CMake
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
May 29, 2024
Fix imgwarp at borders when transparent. opencv#23922 I believe this is a proper fix to opencv#23562 The PR opencv#23754 overwrites data while that should not be the case with transparent data. The original test is failing because points at the border do not get computed because they do not have 4 neighbors to be computed. Still ,we can approximate their computation with whatever neighbors that are available. ### 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. - [x] The feature is well documented and sample code can be built with the project CMake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Readiness Checklist
resolves #23562
I do think that this is a bug because with
INTER_CUBIC + BORDER_TRANSPARENTthe last column and row are preserved. So same should be done forINTER_LINEARSee 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.