From 1fce36a16410cb94e63fc40b42364c5031e15f78 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 15 Nov 2010 20:53:33 +0000 Subject: [PATCH] try to make a more elegant workaround for the incorrectly generated code in Canny (ticket #157) --- modules/imgproc/src/canny.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/imgproc/src/canny.cpp b/modules/imgproc/src/canny.cpp index 0050a5d9ac..64d7b1094f 100644 --- a/modules/imgproc/src/canny.cpp +++ b/modules/imgproc/src/canny.cpp @@ -159,7 +159,7 @@ CV_IMPL void cvCanny( const void* srcarr, void* dstarr, const short* _dy = (short*)(dy->data.ptr + dy->step*i); uchar* _map; int x, y; - int magstep1, magstep2; + ptrdiff_t magstep1, magstep2; int prev_flag = 0; if( i < size.height ) @@ -204,8 +204,8 @@ CV_IMPL void cvCanny( const void* srcarr, void* dstarr, _dx = (short*)(dx->data.ptr + dx->step*(i-1)); _dy = (short*)(dy->data.ptr + dy->step*(i-1)); - magstep1 = (int)(mag_buf[2] - mag_buf[1]); - magstep2 = (int)(mag_buf[0] - mag_buf[1]); + magstep1 = mag_buf[2] - mag_buf[1]; + magstep2 = mag_buf[0] - mag_buf[1]; if( (stack_top - stack_bottom) + size.width > maxsize ) {