Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

How can I draw a boundary across a particular colour in opencv?

$
0
0
#include #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include #include using namespace cv; using namespace std; int main(int argc, char** argv) { VideoCapture cap(0); while(true) { Mat img; cap.read(img); Mat dst; Mat imghsv; cvtColor(img, imghsv, COLOR_BGR2HSV); inRange(imghsv, Scalar(0, 30, 60), Scalar(20, 150, 255), dst ); imshow("name",dst); if (waitKey(30) == 27) //wait for 'esc' key press for 30ms. If 'esc' key is pressed, break loop { cout << "esc key is pressed by user" << endl; break; } } My inrange functions work fine. But I am unable to find a method with which i can draw a boundary to across all the pixels satisfying my threshold range

Viewing all articles
Browse latest Browse all 41027

Trending Articles