Skip to content
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

[identification] fix out of range image access #117

Merged
merged 1 commit into from
Oct 18, 2019

Conversation

fabiencastan
Copy link
Member

Avoid crash when the identification is looking on the image border.

@@ -260,8 +260,8 @@ void extractSignalUsingHomography(
{
applyHomography(xRes, yRes, mHomography, x, y);

if ( xRes >= 1.f && xRes <= src.cols-1 &&
yRes >= 1.f && yRes <= src.rows-1 )
if ( xRes >= 0.f && xRes < src.cols-1 &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either >0 or >=1 i think.
Since the other condition excludes the last pixel, I guess also the first pixel should be excluded (to take into account border pixels, i guess) as it was originally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interpolation inside access to array[int(x)+0] and array[int(x)+1] and interpolate between the 2. So it's not symmetric, as we can retrieve the value on (0,0) but not the value on (width-1, 0).

Copy link
Member

@simogasp simogasp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@simogasp simogasp added this to the v1.0.0 milestone Oct 18, 2019
@fabiencastan fabiencastan merged commit 007a56b into develop Oct 18, 2019
@fabiencastan fabiencastan deleted the fix/identificationBorder branch October 18, 2019 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants