X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=samples%2Fc%2Fcamshiftdemo.c;fp=samples%2Fc%2Fcamshiftdemo.c;h=94e3c447b26332b45c9fb8f766a010f20ef4c299;hb=e4c14cdbdf2fe805e79cd96ded236f57e7b89060;hp=9534966ea0114eb6ded066f33f919518aa7a9bc2;hpb=454138ff8a20f6edb9b65a910101403d8b520643;p=opencv diff --git a/samples/c/camshiftdemo.c b/samples/c/camshiftdemo.c index 9534966..94e3c44 100644 --- a/samples/c/camshiftdemo.c +++ b/samples/c/camshiftdemo.c @@ -2,6 +2,8 @@ #pragma package #endif +#define CV_NO_BACKWARD_COMPATIBILITY + #ifndef _EiC #include "cv.h" #include "highgui.h" @@ -40,7 +42,7 @@ void on_mouse( int event, int x, int y, int flags, void* param ) selection.y = MIN(y,origin.y); selection.width = selection.x + CV_IABS(x - origin.x); selection.height = selection.y + CV_IABS(y - origin.y); - + selection.x = MAX( selection.x, 0 ); selection.y = MAX( selection.y, 0 ); selection.width = MIN( selection.width, image->width ); @@ -85,11 +87,11 @@ CvScalar hsv2rgb( float hue ) int main( int argc, char** argv ) { CvCapture* capture = 0; - + if( argc == 1 || (argc == 2 && strlen(argv[1]) == 1 && isdigit(argv[1][0]))) capture = cvCaptureFromCAM( argc == 2 ? argv[1][0] - '0' : 0 ); else if( argc == 2 ) - capture = cvCaptureFromAVI( argv[1] ); + capture = cvCaptureFromAVI( argv[1] ); if( !capture ) { @@ -176,14 +178,14 @@ int main( int argc, char** argv ) cvTermCriteria( CV_TERMCRIT_EPS | CV_TERMCRIT_ITER, 10, 1 ), &track_comp, &track_box ); track_window = track_comp.rect; - + if( backproject_mode ) cvCvtColor( backproject, image, CV_GRAY2BGR ); if( !image->origin ) track_box.angle = -track_box.angle; cvEllipseBox( image, track_box, CV_RGB(255,0,0), 3, CV_AA, 0 ); } - + if( select_object && selection.width > 0 && selection.height > 0 ) { cvSetImageROI( image, selection );