Skip to content

Use texture Object to make cv::cuda::HoughSegmentDetectorImpl::detect() thread-safe #3185

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

Merged
merged 2 commits into from
Mar 4, 2022

Conversation

mitul93
Copy link
Contributor

@mitul93 mitul93 commented Feb 28, 2022

This PR fixes #3184 by using texture Object to make cv::cuda::HoughSegmentDetectorImpl::detect() thread-safe.

This PR also includes unit test for probabilistic hough segment detector. Previously, there was no unit test for this function.

Also note that, this solution is only thread-safe for CV_CUDEV_ARCH>=300. This is the same solution as existing code for canny algorithm that is already part of opencv_contrib. See here : 6ca24c8

Pull Request Readiness Checklist

  • 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
force_builders=Custom
buildworker:Custom=linux-4,linux-6
build_image:Custom=ubuntu-cuda:18.04

@deadprogram
Copy link
Contributor

The macOS test build that fails does not appear to be related to any modules in this change. Or am I missing something here?

@deadprogram
Copy link
Contributor

@alalek or any other maintainers, can you please help us get the CI passing? It is not clear how the change from this PR would impact the test from a different module, and then only on macOS.

Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

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

👍

@asmorkalov
Copy link
Contributor

I re-triggered CI build on Mac. Let's wait for status.

@deadprogram
Copy link
Contributor

Looks like CI now all passing thanks for re-triggering the build @asmorkalov

@asmorkalov asmorkalov self-requested a review March 4, 2022 06:27
Copy link
Contributor

@deadprogram deadprogram left a comment

Choose a reason for hiding this comment

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

I think all requested changes have now been made, and also all CI tests are now passing green.

@alalek alalek merged commit 6a71751 into opencv:4.x Mar 4, 2022
@opencv-pushbot opencv-pushbot mentioned this pull request Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cv::cuda::HoughSegmentDetector crashes when used in multiple threads
4 participants