1

I am writing a code to extract yellow color alone from a video feed. After Converting it to HSV i feed that frame in inRangeS Function. I also have a Upperlimit, lower limit and output frame.

This is my code:-

cam>>frame; imshow("Main",frame); cvtColor(frame,frame,COLOR_BGR2HSV); imshow("HSV",frame); cvInRange(frame,cvScalar(20,100,100),cvScalar(30,255,255),redspace); imshow("Red",redspace); 

it gives the following error:-

error: cannot convert ‘cv::Mat’ to ‘const CvArr* {aka const void*}’ for argument ‘1’ to ‘void cvInRange(const CvArr*, const CvArr*, const CvArr*, CvArr*)’ cvInRange(frame,cvScalar(20,100,100),cvScalar(30,255,255),redspace); 

1 Answer 1

2

You are using cvInRange function from the old C interface of OpenCV.

If you are using cv::Mat, the function cv::inRange from the C++ interface has to be used as follows.

cv::inRange(frame,cv::Scalar(20,100,100),cv::Scalar(30,255,255),redspace); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.