Fix bias in HoughLines with even number of rho discretization steps

#25038
This commit is contained in:
quantumwebx 2024-02-17 03:30:42 +05:30
parent a9f15d7372
commit 8ed9819713
2 changed files with 2 additions and 1 deletions

View File

@ -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.

View File

@ -214,7 +214,7 @@ HoughLinesStandard( InputArray src, OutputArray lines, int type,
int idx = _sort_buf[i];
int n = cvFloor(idx*scale) - 1;
int r = idx - (n+1)*(numrho+2) - 1;
line.rho = (r - (numrho - 1)*0.5f) * rho;
line.rho = (r - (numrho - 1)/2) * rho;
line.angle = static_cast<float>(min_theta) + n * theta;
if (type == CV_32FC2)
{