mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
Fix bias in HoughLines with even number of rho discretization steps
#25038
This commit is contained in:
parent
a9f15d7372
commit
8ed9819713
@ -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 Mastodon](http://mastodon.social/@opencv) in the Fediverse
|
||||||
* [Follow OpenCV on Twitter](https://twitter.com/opencvlive)
|
* [Follow OpenCV on Twitter](https://twitter.com/opencvlive)
|
||||||
* [OpenCV.ai](https://opencv.ai): Computer Vision and AI development services from the OpenCV team.
|
* [OpenCV.ai](https://opencv.ai): Computer Vision and AI development services from the OpenCV team.
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ HoughLinesStandard( InputArray src, OutputArray lines, int type,
|
|||||||
int idx = _sort_buf[i];
|
int idx = _sort_buf[i];
|
||||||
int n = cvFloor(idx*scale) - 1;
|
int n = cvFloor(idx*scale) - 1;
|
||||||
int r = idx - (n+1)*(numrho+2) - 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;
|
line.angle = static_cast<float>(min_theta) + n * theta;
|
||||||
if (type == CV_32FC2)
|
if (type == CV_32FC2)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user