-
Couldn't load subscription status.
- Fork 5.9k
Added a fix for issue 2102. #2103
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
|
@AHolliday Thank you for investigating of this problem! @the-glu Could you take a look on this patch? |
|
@AHolliday Looks like there is no objections about the fix (also there are no automatic tests for this functionality too), so lets apply proposed fix 👍 As a "bugfix" this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly). So, please:
Note: no needs to re-open PR, apply changes "inplace". |
|
Something goes wrong here with git, so GitHub closes PR (and it can't be reopened for now at least from our/maintainers side). Please revert changes back, something like: (some extra commands to recover source tree: Then try re-open this PR. If anything fails, then open new PR (from 3.4 branch) with cross-link on this PR. |
|
Alright, I made a new PR: #2132
…On Fri, 31 May 2019 at 03:08, Alexander Alekhin ***@***.***> wrote:
Something goes wrong here with git, so GitHub closes PR (and it can't be
reopened for now at least from our/maintainers side).
Please revert changes back, something like:
git checkout -B fix_2102 54bac53
git push origin fix_2102 -f
(some extra commands to recover source tree: git stash, git rebase --abort
)
Then try re-open this PR.
------------------------------
If anything fails, then open new PR (from 3.4 branch) with cross-link on
this PR.
Backup of your patch is here
<https://github.com/alalek/opencv_contrib/commits/pr2103>.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#2103?email_source=notifications&email_token=ABIUHM3LH5SISDBO47F4MHTPYDFFBA5CNFSM4HHIJZNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWUMUXQ#issuecomment-497601118>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABIUHM4BBNEN2HXDBYER2XDPYDFFBANCNFSM4HHIJZNA>
.
|
|
Although it seems now that the patch is failing to pass the cmake tests.
…On Sat, 1 Jun 2019 at 08:55, Andrew Holliday ***@***.***> wrote:
Alright, I made a new PR:
#2132
On Fri, 31 May 2019 at 03:08, Alexander Alekhin ***@***.***>
wrote:
> Something goes wrong here with git, so GitHub closes PR (and it can't be
> reopened for now at least from our/maintainers side).
>
> Please revert changes back, something like:
>
> git checkout -B fix_2102 54bac53
> git push origin fix_2102 -f
>
> (some extra commands to recover source tree: git stash, git rebase
> --abort)
>
> Then try re-open this PR.
> ------------------------------
>
> If anything fails, then open new PR (from 3.4 branch) with cross-link on
> this PR.
> Backup of your patch is here
> <https://github.com/alalek/opencv_contrib/commits/pr2103>.
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <#2103?email_source=notifications&email_token=ABIUHM3LH5SISDBO47F4MHTPYDFFBA5CNFSM4HHIJZNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWUMUXQ#issuecomment-497601118>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABIUHM4BBNEN2HXDBYER2XDPYDFFBANCNFSM4HHIJZNA>
> .
>
|
resolves #2102
This pullrequest changes
During one of the stages of selective search, the image is rotated 45 degrees and gradients are computed along the X and Y directions in the rotated image. The gradient image is then rotated back to the original orientation and cropped to remove surrounding empty space, leaving it with the same shape as the original image. However, the implementation of the crop will specify an ROI with negative x or y values if the image's native aspect ratio is too high or too low (basically, if the image is far from square).
This is because the bounding box of the rotated image is strictly bigger than the original image if the original is sufficiently close to square; but if the original is too "skinny", the bounding box of its rotation will be less tall or wide than the original.
The fix is to threshold the x and y computed for the ROI at 0.
Note: while fixing this bug, I also discovered that parts of "narrow" gradient images were being clipped at their edges due to improper cropping, again due to the apparent assumption that the bounding box of the rotated image was always strictly bigger in both axes than the original image. This PR includes a fix for that as well.