Skip to content

cudalegacy: fix wrong index#19383

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
tomoaki0705:fixWrongIndex
Jan 24, 2021
Merged

cudalegacy: fix wrong index#19383
opencv-pushbot merged 1 commit intoopencv:3.4from
tomoaki0705:fixWrongIndex

Conversation

@tomoaki0705
Copy link
Copy Markdown
Contributor

@tomoaki0705 tomoaki0705 commented Jan 23, 2021

This image_normalized is created as a single column vector.

_dst.create(npoints, 1, CV_MAKETYPE(depth, 2), -1, true);

This part should scan in (i, 0) and not (0, i)

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • 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
force_builders=Custom
buildworker:Custom=linux-4
build_image:Custom=ubuntu-cuda:18.04

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

p_proj.x = p_transf.x / p_transf.z;
p_proj.y = p_transf.y / p_transf.z;
if (norm(p_proj - image_normalized.at<Point2f>(0, i)) < max_dist)
if (norm(p_proj - image_normalized.at<Point2f>(i, 0)) < max_dist)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

BTW, Mat::at(i) should be correct too (for both 1 x n / n x 1 layouts) - method has complex implementation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you.
Let me modify it to Mat::at(i)

@opencv-pushbot opencv-pushbot merged commit fb0abde into opencv:3.4 Jan 24, 2021
@tomoaki0705 tomoaki0705 deleted the fixWrongIndex branch January 24, 2021 20:35
This was referenced Jan 25, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug category: gpu/cuda (contrib) OpenCV 4.0+: moved to opencv_contrib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants