Skip to content
Snippets Groups Projects
Commit 864ec7e2 authored by ariotte's avatar ariotte
Browse files

fixed dimension problem

parent 81e93943
No related branches found
No related tags found
No related merge requests found
...@@ -116,7 +116,7 @@ Image_t<double>* Transforms::hough(const GrayscaleImage *image ) { ...@@ -116,7 +116,7 @@ Image_t<double>* Transforms::hough(const GrayscaleImage *image ) {
Image_t<double>* Transforms::hough2(const Image *image, double angleStep, double rhoStep) { Image_t<double>* Transforms::hough2(const Image *image, double angleStep, double rhoStep) {
double imageDiag = sqrt(image->getWidth()*image->getWidth() + image->getHeight()*image->getHeight()); double imageDiag = sqrt(image->getWidth()*image->getWidth() + image->getHeight()*image->getHeight());
Image_t<double>* resImg = new Image_t<double>( 181 / angleStep, (1. + imageDiag * 2) / rhoStep, image->getNbChannels(), 0.); Image_t<double>* resImg = new Image_t<double>( 180 / angleStep + 1 , ( imageDiag * 2) / rhoStep + 1, image->getNbChannels(), 0.);
for(unsigned int c = 0; c < image->getNbChannels(); c++) { for(unsigned int c = 0; c < image->getNbChannels(); c++) {
...@@ -183,7 +183,7 @@ string Transforms::hough2_inverse(const Image_t<double> *image, Image** resImgpt ...@@ -183,7 +183,7 @@ string Transforms::hough2_inverse(const Image_t<double> *image, Image** resImgpt
double angleStep = 180. / (image->getWidth() - 1) ; double angleStep = 180. / (image->getWidth() - 1) ;
double imageDiag = sqrt(width*width + height*height); double imageDiag = sqrt(width*width + height*height);
double rhoStep = imageDiag / ( (image->getHeight() - 1 ) /2 ); double rhoStep = imageDiag * 2 / (image->getHeight() - 1);
//Algorithme de traitement //Algorithme de traitement
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment