Skip to content

Commit 16687a2

Browse files
author
Andrey Kamaev
committed
Explicitly use double precision sin & cos in hough implementation
On some platforms sin and cos are calculated in single precision resulting in diversity of results.
1 parent 6bc7953 commit 16687a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/imgproc/src/hough.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ icvHoughLinesStandard( const CvMat* img, float rho, float theta,
118118
float ang = 0;
119119
for(int n = 0; n < numangle; ang += theta, n++ )
120120
{
121-
tabSin[n] = (float)(sin(ang) * irho);
122-
tabCos[n] = (float)(cos(ang) * irho);
121+
tabSin[n] = (float)(sin((double)ang) * irho);
122+
tabCos[n] = (float)(cos((double)ang) * irho);
123123
}
124124

125125
// stage 1. fill accumulator

0 commit comments

Comments
 (0)