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.
This commit is contained in:
parent
6bc795308e
commit
16687a2655
@ -118,8 +118,8 @@ icvHoughLinesStandard( const CvMat* img, float rho, float theta,
|
|||||||
float ang = 0;
|
float ang = 0;
|
||||||
for(int n = 0; n < numangle; ang += theta, n++ )
|
for(int n = 0; n < numangle; ang += theta, n++ )
|
||||||
{
|
{
|
||||||
tabSin[n] = (float)(sin(ang) * irho);
|
tabSin[n] = (float)(sin((double)ang) * irho);
|
||||||
tabCos[n] = (float)(cos(ang) * irho);
|
tabCos[n] = (float)(cos((double)ang) * irho);
|
||||||
}
|
}
|
||||||
|
|
||||||
// stage 1. fill accumulator
|
// stage 1. fill accumulator
|
||||||
|
Loading…
x
Reference in New Issue
Block a user