From a94aa2cb41ed0eeac4a9bc94a2e780e7de053dde Mon Sep 17 00:00:00 2001 From: ariotte <ariotte@PC-EII16.admr.insa> Date: Fri, 29 Jun 2018 11:41:22 +0200 Subject: [PATCH] fixed hough transform on non-square image --- app/Operations/Transforms.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Operations/Transforms.cpp b/app/Operations/Transforms.cpp index 8f05cad..27fa93a 100644 --- a/app/Operations/Transforms.cpp +++ b/app/Operations/Transforms.cpp @@ -263,9 +263,10 @@ string Transforms::hough2_inverse(const Image_t<double> *image, Image** resImgpt // sprintf( buffer, "Valeur Max de la matrice d'entre=%d",(int)(max+0.1)); - double angleStep = 271. / image->getHeight(); //les angles varient de -90 Ã +180 = intervalle de longueur 271 degre - double imageDiag = resImg->getWidth() * sqrt(2.); - double rhoStep = imageDiag / image->getWidth(); + double angleStep = 270. / image->getHeight(); //les angles varient de -90 Ã +180 = intervalle de longueur 271 degre + //double imageDiag = resImg->getWidth() * sqrt(2.); + double imageDiag = sqrt(width*width + height*height); + double rhoStep = imageDiag / (image->getWidth() - 1 ); //Algorithme de traitement -- GitLab