From 16687a265546c0533dc629917c959233c68fc7ec Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Tue, 25 Dec 2012 18:05:05 +0400 Subject: [PATCH] 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. --- modules/imgproc/src/hough.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/hough.cpp b/modules/imgproc/src/hough.cpp index 6b5c2e45ce..3e737d8bb6 100644 --- a/modules/imgproc/src/hough.cpp +++ b/modules/imgproc/src/hough.cpp @@ -118,8 +118,8 @@ icvHoughLinesStandard( const CvMat* img, float rho, float theta, float ang = 0; for(int n = 0; n < numangle; ang += theta, n++ ) { - tabSin[n] = (float)(sin(ang) * irho); - tabCos[n] = (float)(cos(ang) * irho); + tabSin[n] = (float)(sin((double)ang) * irho); + tabCos[n] = (float)(cos((double)ang) * irho); } // stage 1. fill accumulator