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

Fix bias in HoughLines with even number of rho discretization steps #25038 #25043

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

Adi-gitX
Copy link

#25038

Description:
Replace the multiplication by 0.5f with a division by int(2) in the calculation of rho value to address potential bias in Hough Line Transform.

Changes Made:
Modified the calculation of the rho value in Hough Line Transform by changing the expression from (r - (numrho - 1)*0.5f) * rho to (r - (numrho - 1)/2) * rho.

Purpose:
To fix a potential bias issue in the calculated rho values of detected lines in the Hough Line Transform.

Related Issue:
No specific issue tracked. This change addresses a potential issue identified in the codebase.

Additional Information:
This change has been tested locally and verified to resolve the bias issue in rho values without affecting the functionality of the Hough Line Transform.

@@ -34,3 +34,4 @@ Please read the [contribution guidelines](https://github.com/opencv/opencv/wiki/
* [Follow OpenCV on Mastodon](http://mastodon.social/@opencv) in the Fediverse
* [Follow OpenCV on Twitter](https://twitter.com/opencvlive)
* [OpenCV.ai](https://opencv.ai): Computer Vision and AI development services from the OpenCV team.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not touch irrelevant files.

@vpisarev
Copy link
Contributor

vpisarev commented Mar 7, 2024

@Adi-gitX , thank you for the patch! Could you port the test from the issue to C++ and add it as OpenCV test to check that your fix is proper?

@asmorkalov asmorkalov modified the milestones: 4.10.0, 4.11.0 May 31, 2024
@Adi-gitX Adi-gitX requested a review from asmorkalov December 18, 2024 16:48
@asmorkalov asmorkalov modified the milestones: 4.11.0, 4.12.0 Dec 19, 2024
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.

3 participants