diff options
author | N.N. <sevyves@users.sourceforge.net> | 2010-08-08 15:24:58 +0000 |
---|---|---|
committer | N.N. <sevyves@users.sourceforge.net> | 2010-08-08 15:24:58 +0000 |
commit | 9a4fb3c214d03bb3dc452c24a1b2a91cbdcd5e38 (patch) | |
tree | 88bd0bd1d4d6656db64b27e7dbb827286226b6ae | |
parent | f3dcc3c0ac316ed09f18783d0bd321ee07d43214 (diff) |
do not draw inexisting contours
svn path=/trunk/externals/pdp_opencv/; revision=13772
-rwxr-xr-x | pdp_opencv_contours_boundingrect.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pdp_opencv_contours_boundingrect.cc b/pdp_opencv_contours_boundingrect.cc index 97aa06d..a3ae202 100755 --- a/pdp_opencv_contours_boundingrect.cc +++ b/pdp_opencv_contours_boundingrect.cc @@ -195,6 +195,8 @@ static void pdp_opencv_contours_boundingrect_process_rgb(t_pdp_opencv_contours_b // draw old contours for ( im=0; im<MAX_MARKERS; im++ ) { + if ( x_xmark[im]==-1 ) continue; + cvRectangle( x->cnt_img, cvPoint((int)(x->x_xmark[im]-x->x_wmark[im]/2),(int)(x->x_ymark[im]-x->x_hmark[im]/2)), cvPoint((int)(x->x_xmark[im]+x->x_wmark[im]/2),(int)(x->x_ymark[im]+x->x_hmark[im]/2)), CV_RGB(0,0,255), 2, 8, 0 ); sprintf( tindex, "%d", im ); |