Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

imgproc(ocl): Fix min_theta/max_theta handling in OpenCL HoughLines (Fixes #28036)#28097

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
AKash-A007 wants to merge2 commits intoopencv:4.x
base:4.x
Choose a base branch
Loading
fromAKash-A007:fix-houghlines-ocl-minmax

Conversation

@AKash-A007
Copy link
Contributor

Fix OpenCL HoughLines incorrect theta range handling

The OpenCL implementation of cv::HoughLines was ignoring the user-provided
min_theta and max_theta range, always assuming a full [0, PI) span. This leads
to a mismatch between CPU and OCL results for limited-angle Hough transforms.

Changes in this PR

  • Pass minTheta, maxTheta, and computed theta_step from the C++ dispatcher
  • Update get_lines OpenCL kernel to compute:
    angle = minTheta + idx * theta_step
  • Add USE_MINMAX_THETA build flag for clarity and kernel configuration
  • Add CPU vs OCL consistency test for restricted-angle HoughLines

Why this matters

This bug caused incorrect results when using min_theta/max_theta on GPU via UMat.
This PR aligns OpenCL behavior with the CPU implementation and restores
correctness for limited-angle Hough transforms.

Issue

Fixes#28036

Pull Request Readiness Checklist

See details athttps://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

…ughLines- Pass minTheta/maxTheta and corrected theta_step from C++ dispatcher- Modify OpenCL kernel to use angle = minTheta + idx * theta_step- Align OCL behavior with CPU HoughLinesStandard implementation- Add CPU vs OCL consistency testFixesopencv#28036
@AKash-A007AKash-A007force-pushed thefix-houghlines-ocl-minmax branch from1d25aa6 toe818e2eCompareDecember 5, 2025 14:48
@AKash-A007AKash-A007force-pushed thefix-houghlines-ocl-minmax branch frome818e2e to07a3e22CompareDecember 5, 2025 15:05
@AKash-A007
Copy link
ContributorAuthor

@asmorkalov Just a gentle reminder to review this PR whenever convenient. The fix aligns the OCL HoughLines behavior with the CPU implementation for restricted theta ranges. Appreciate your time!

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

cv::HoughLines with OpenCL use min_theta/max_theta incorrectly

1 participant

@AKash-A007

[8]ページ先頭

©2009-2025 Movatter.jp