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<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
}
}