Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Intensity value based tracking

I want to draw a rectangle in opencv according to the pixel intensity i.e. i don't want to give a static values to cvRectangle like cv::point1 or cv::point2. I want that whenever specific intensity value is encountered it draws a rectangle around that object. I got a sample like this but it's not what i want how should i modify this pMOG->operator()(frame, fgMaskMOG); while(frame.data!=NULL) { for(int i=0;i<frame.row;i++) {="" for(int="" j="0;j&lt;frame.col;j++)" {="" if(frame.at<uchar="">(i,j)=='0') //std::vector<rect> frame; cv::rectangle(frame, // the dest image cvPoint(100, 100), // top left point cvPoint(300, 30), // bottom right point cvScalar(255, 0, 0, 0), // the color; blue 3, 8, 0); // thickness, line type, shift

 }
     }

Intensity value based tracking

I want to draw a rectangle in opencv according to the pixel intensity i.e. i don't want to give a static values to cvRectangle like cv::point1 or cv::point2. I want that whenever specific intensity value is encountered it draws a rectangle around that object. I got a sample like this but it's not what i want how should i modify this

pMOG->operator()(frame, fgMaskMOG); while(frame.data!=NULL) { for(int i=0;i<frame.row;i++) {="" for(int="" j="0;j&lt;frame.col;j++)" {="" if(frame.at<uchar="">(i,j)=='0') //std::vector<rect> frame; cv::rectangle(frame, // the dest image cvPoint(100, 100), // top left point cvPoint(300, 30), // bottom right point cvScalar(255, 0, 0, 0), // the color; blue 3, 8, 0); // thickness, line type, shift

 }
     }
click to hide/show revision 3
retagged

updated 2014-05-02 11:44:19 -0600

berak gravatar image

Intensity value based tracking

I want to draw a rectangle in opencv according to the pixel intensity i.e. i don't want to give a static values to cvRectangle like cv::point1 or cv::point2. I want that whenever specific intensity value is encountered it draws a rectangle around that object. I got a sample like this but it's not what i want how should i modify this

pMOG->operator()(frame, fgMaskMOG); while(frame.data!=NULL) { for(int i=0;i<frame.row;i++) {="" for(int="" j="0;j&lt;frame.col;j++)" {="" if(frame.at<uchar="">(i,j)=='0') //std::vector<rect> frame; cv::rectangle(frame, // the dest image cvPoint(100, 100), // top left point cvPoint(300, 30), // bottom right point cvScalar(255, 0, 0, 0), // the color; blue 3, 8, 0); // thickness, line type, shift

 }
     }

Intensity value based tracking

I want to draw a rectangle in opencv according to the pixel intensity i.e. i don't want to give a static values to cvRectangle like cv::point1 or cv::point2. I want that whenever specific intensity value is encountered it draws a rectangle around that object. I got a sample like this but it's not what i want how should i modify this

pMOG->operator()(frame, fgMaskMOG); while(frame.data!=NULL) fgMaskMOG);

while(frame.data!=NULL)

 {
      for(int i=0;i<frame.row;i++) {="" for(int="" j="0;j&lt;frame.col;j++)" {="" if(frame.at<uchar="">(i,j)=='0')
             //std::vector<rect> i=0;i<frame.row;i++)
     {
         for(int j=0;j<frame.col;j++)
         {
     if(frame.at<uchar>(i,j)=='0')
         //std::vector<Rect> frame;
          cv::rectangle(frame,                    // the dest image 
           cvPoint(100, 100),      // top left point 
           cvPoint(300, 30),       // bottom right point 
           cvScalar(255, 0, 0, 0), // the color; blue 
           3, 8, 0);               // thickness, line type, shift 

  }
     }