diff --git a/samples/c/contours.c b/samples/c/contours.c index e53a25a042..58939e47af 100644 --- a/samples/c/contours.c +++ b/samples/c/contours.c @@ -19,10 +19,11 @@ CvSeq* contours = 0; static void on_trackbar(int pos) { - (void)pos; IplImage* cnt_img = cvCreateImage( cvSize(w,w), 8, 3 ); CvSeq* _contours = contours; int _levels = levels - 3; + (void)pos; + if( _levels <= 0 ) // get to the nearest face to make it look more funny _contours = _contours->h_next->h_next->h_next; cvZero( cnt_img ); @@ -53,13 +54,14 @@ static void findCComp( IplImage* img ) int main(int argc, char* argv[]) { - (void)argc; (void)argv; int i, j; CvMemStorage* storage = cvCreateMemStorage(0); IplImage* img = cvCreateImage( cvSize(w,w), 8, 1 ); IplImage* img32f = cvCreateImage( cvSize(w,w), IPL_DEPTH_32F, 1 ); IplImage* img32s = cvCreateImage( cvSize(w,w), IPL_DEPTH_32S, 1 ); IplImage* img3 = cvCreateImage( cvSize(w,w), 8, 3 ); + (void)argc; (void)argv; + help(); cvZero( img ); diff --git a/samples/c/fback_c.c b/samples/c/fback_c.c index 2a061e96ae..af613d25e4 100644 --- a/samples/c/fback_c.c +++ b/samples/c/fback_c.c @@ -16,8 +16,8 @@ static void help(void) static void drawOptFlowMap(const CvMat* flow, CvMat* cflowmap, int step, double scale, CvScalar color) { - (void)scale; int x, y; + (void)scale; for( y = 0; y < cflowmap->rows; y += step) for( x = 0; x < cflowmap->cols; x += step) { @@ -30,9 +30,9 @@ static void drawOptFlowMap(const CvMat* flow, CvMat* cflowmap, int step, int main( int argc, char** argv ) { - (void)argc; (void)argv; CvCapture* capture = cvCreateCameraCapture(0); CvMat* prevgray = 0, *gray = 0, *flow = 0, *cflow = 0; + (void)argc; (void)argv; help(); diff --git a/samples/c/morphology.c b/samples/c/morphology.c index ac89953402..3071490599 100644 --- a/samples/c/morphology.c +++ b/samples/c/morphology.c @@ -17,9 +17,10 @@ int erode_dilate_pos = 0; // callback function for open/close trackbar static void OpenClose(int pos) { - (void)pos; int n = open_close_pos - max_iters; int an = n > 0 ? n : -n; + (void)pos; + element = cvCreateStructuringElementEx( an*2+1, an*2+1, an, an, element_shape, 0 ); if( n < 0 ) { @@ -38,9 +39,10 @@ static void OpenClose(int pos) // callback function for erode/dilate trackbar static void ErodeDilate(int pos) { - (void)pos; int n = erode_dilate_pos - max_iters; int an = n > 0 ? n : -n; + (void)pos; + element = cvCreateStructuringElementEx( an*2+1, an*2+1, an, an, element_shape, 0 ); if( n < 0 ) {