Skip to content

rgbd: fix registerDepth with larger input depth - #4235

Open
sridhar-git05 wants to merge 1 commit into
opencv:4.xfrom
sridhar-git05:fix-rgbd-register-depth-3761
Open

sridhar-git05 wants to merge 1 commit into
opencv:4.xfrom
sridhar-git05:fix-rgbd-register-depth-3761

Conversation

@sridhar-git05

Copy link
Copy Markdown

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 another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the 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

Fixes #3761.

registerDepth() allocated the intermediate Point3f buffer using
outputImagePlaneSize. When the input depth image was larger than the
requested output image plane, the registration loop wrote one 3D point
for every input depth pixel, causing an out-of-bounds access.

Allocate the intermediate buffer using unregisteredDepth.size() instead,
so it contains one element for every input depth pixel.

Added a regression test covering a 1000x1000 depth image registered to a
300x300 output image.

Testing:

  • Added Rgbd_DepthRegistration.issue_3761.
  • Verified Rgbd_DepthRegistration.issue_3761 passes with a Debug build of the rgbd module.
  • git diff --check passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant