0

私は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;

}

4

1 に答える 1