我已经开始学习opencv并编写了下面的代码来获取hsv中的图像(来自输入相机)和inRange图像的输出!hsv 输出很好,但 inRange o/p 只是空白:| 请帮助我难过
int main(int argc[], char** argv[])
{
VideoCapture camera(CV_CAP_ANY);
Mat input;
Mat output(Size(input.size().height,input.size().width),input.type());
Mat img_thresh(Size(640,480),input.type());
namedWindow("input",0);
namedWindow("output",0);
namedWindow("threshold",0);
cv::Scalar hsv_min = cvScalar(0, 30, 80, 0);
cv::Scalar hsv_max = cvScalar(20, 150, 255, 0);
for(;;)
{
camera >> input;
cvtColor(input,output,CV_BGR2HSV,1);
cv::inRange(input,hsv_min,hsv_max,img_thresh);
imshow("input",input);
imshow("output",output);
imshow("threshold",img_thresh);
cv::waitKey(40);
}
return 0;
}