Hot fix negative MTCNN PNet ROI coordinates#20245
Merged
alalek merged 3 commits intoopencv:masterfrom Jun 9, 2021
Merged
Conversation
alalek
reviewed
Jun 8, 2021
| cv::Rect tmp_rect = face.bbox.getRect(); | ||
| //Compare to transposed sizes width<->height | ||
| tmp_rect &= cv::Rect(tmp_rect.x, tmp_rect.y, in_image_size.height - tmp_rect.x - 4, in_image_size.width - tmp_rect.y - 4); | ||
| tmp_rect &= cv::Rect(std::max(tmp_rect.x, 0), std::max(tmp_rect.y, 0), in_image_size.height - tmp_rect.x - 4, in_image_size.width - tmp_rect.y - 4); |
Member
There was a problem hiding this comment.
if tmp_rect.x is negative, then probably the width argument is not calculated properly too (e.g, it may exceed image size).
What is about this?
tmp_rect &= cv::Rect(...previous variant...) & cv::Rect(0, 0, in_image_size.height - 4, in_image_size.width - 4)
Contributor
There was a problem hiding this comment.
- if possible, please give a name for 4 :)
Author
There was a problem hiding this comment.
I'm stuck trying to give a name for 4. So I just removed it. :)
Contributor
|
i suppose the a negative value could appeared from here IMHO, the fix should be here |
added 2 commits
June 9, 2021 11:36
Author
|
@alalek let's merge. I tried multiple video inputs. Everything works just fine now. |
Merged
Merged
a-sajjad72
pushed a commit
to a-sajjad72/opencv
that referenced
this pull request
Mar 30, 2023
…_hotfix Hot fix negative MTCNN PNet ROI coordinates * fix negative roi start * some more experiments * clean up
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
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.
force_builders=Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f
build_image:Custom=centos:7
buildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f
Xbuild_image:Custom=ubuntu-openvino-2020.3.0:16.04
build_image:Custom Win=openvino-2021.3.0
build_image:Custom Mac=openvino-2021.3.0
test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,python2,python3,java
buildworker:Custom=linux-1
// disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*