I try to run the following code:
#include<opencv\cv.h>
#include<opencv\highgui.h>
using namespace cv;
int main() {
VideoCapture cap;
cap.open(0);
while (1) {
Mat src;
Mat threshold;
cap.read(src);
inRange(src, Scalar(0, 0, 0), Scalar(255, 0, 0), threshold);
imshow("thr", threshold);
imshow("hsv", src);
waitKey(33);
}
return 0;
}
But it seems like it doesn't filter because there is only a blank window appearing when I run the code.
How to get that code to detect red colors?