Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how do i do a multi color tracking?

i trying to do a if else statement to color detection, if the cvinranges detect red, then it will show video with red threshold, here is my code :

cvCvtColor(frame, hsv_frame, CV_BGR2HSV); cvInRangeS(hsv_frame,hsv_min,hsv_max, thresholded); if(hsv_min = CvScalar(150 , 84, 130, 0),hsv_max = cvScalar(358, 256, 255, 0)); { cvSmooth( thresholded, thresholded, CV_GAUSSIAN, 9, 9 ); cvShowImage( "After Color Filtering", thresholded ); }

the problem occur : in if statement, hsv_min show me a (expression must have bool type) error, how could i overcome it ?

how do i do a multi color tracking?

i trying to do a if else statement to color detection, if the cvinranges detect red, then it will show video with red threshold, here is my code :

 cvCvtColor(frame, hsv_frame, CV_BGR2HSV);
  cvInRangeS(hsv_frame,hsv_min,hsv_max, thresholded);
   if(hsv_min = CvScalar(150 , 84, 130, 0),hsv_max = cvScalar(358, 256, 255, 0));
    {
      cvSmooth( thresholded, thresholded, CV_GAUSSIAN, 9, 9 );
      cvShowImage( "After Color Filtering", thresholded );
        }

}

the problem occur : in if statement, hsv_min show me a (expression must have bool type) error, how could i overcome it ?

how do i do a multi color tracking?

i I am trying to do a if else statement to color detection, if the cvinranges cvInRanges detect red, then it will show video with red threshold, here is my code :

 cvCvtColor(frame, hsv_frame, CV_BGR2HSV);
 cvInRangeS(hsv_frame,hsv_min,hsv_max, thresholded);
  if(hsv_min = CvScalar(150 , 84, 130, 0),hsv_max = cvScalar(358, 256, 255, 0));
   {
     cvSmooth( thresholded, thresholded, CV_GAUSSIAN, 9, 9 );
     cvShowImage( "After Color Filtering", thresholded );
    }

the problem occur : in if statement, hsv_min show me a (expression must have bool type) error, how could i overcome it ?