diff options
author | N.N. <sevyves@users.sourceforge.net> | 2009-09-04 02:50:25 +0000 |
---|---|---|
committer | N.N. <sevyves@users.sourceforge.net> | 2009-09-04 02:50:25 +0000 |
commit | 5ae144ffeb8ac5efe3f63cf35a8d1c490ae05f4e (patch) | |
tree | 7ca21d61de971b9c8c49c7cda04c66baa9294565 | |
parent | 8f0e0686d06484cf9c2125590aa6e1a8984aeb8d (diff) |
delaunay bug fix
svn path=/trunk/externals/pix_opencv/; revision=12237
-rwxr-xr-x | pix_opencv_lk.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pix_opencv_lk.cc b/pix_opencv_lk.cc index 57edaf1..7de183a 100755 --- a/pix_opencv_lk.cc +++ b/pix_opencv_lk.cc @@ -129,10 +129,11 @@ void pix_opencv_lk :: processRGBAImage(imageStruct &image) } memcpy( rgba->imageData, image.data, image.xsize*image.ysize*4 ); + cvCvtColor(rgba, rgb, CV_BGRA2RGB); cvCvtColor(rgba, grey, CV_BGRA2GRAY); if( night_mode ) - cvZero( rgba ); + cvZero( rgb ); for ( im=0; im<MAX_MARKERS; im++ ) { @@ -237,7 +238,7 @@ void pix_opencv_lk :: processRGBAImage(imageStruct &image) } } - cvCircle( rgba, cvPointFrom32f(points[1][i]), 3, CV_RGB(0,255,0), -1, 8,0); + cvCircle( rgb, cvPointFrom32f(points[1][i]), 3, CV_RGB(0,255,0), -1, 8,0); marked=0; for ( im=0; im<MAX_MARKERS; im++ ) @@ -250,7 +251,7 @@ void pix_opencv_lk :: processRGBAImage(imageStruct &image) { char tindex[4]; sprintf( tindex, "%d", im+1 ); - cvPutText( rgba, tindex, cvPointFrom32f(points[1][i]), &font, CV_RGB(255,255,255)); + cvPutText( rgb, tindex, cvPointFrom32f(points[1][i]), &font, CV_RGB(255,255,255)); x_xmark[im]=(int)points[1][i].x; x_ymark[im]=(int)points[1][i].y; x_found[im]=ftolerance; @@ -339,7 +340,7 @@ void pix_opencv_lk :: processRGBAImage(imageStruct &image) ( dst.x > 0 ) && ( dst.x < comp_xsize ) && ( org.y > 0 ) && ( org.y < comp_ysize ) && ( dst.y > 0 ) && ( dst.y < comp_ysize ) ) - cvLine( rgba, iorg, idst, CV_RGB(255,0,0), 1, CV_AA, 0 ); + cvLine( rgb, iorg, idst, CV_RGB(255,0,0), 1, CV_AA, 0 ); } } @@ -352,6 +353,7 @@ void pix_opencv_lk :: processRGBAImage(imageStruct &image) CV_SWAP( points[0], points[1], swap_points ); need_to_init = 0; + cvCvtColor(rgb, rgba, CV_BGR2BGRA); memcpy( image.data, rgba->imageData, image.xsize*image.ysize*4 ); } |