フレームのいくつかの領域を見つけようとしています。フレームはYcbcr色空間にあります。Y値に基づいてこれらの領域を選択する必要があります。
だから私はこのコードを書いた:
Mat frame. ychannel;
VideoCapture cap(1);
int key =0;
int maxV , minV;
Point max, min;
while(key != 27){
cap >> frame;
cvtColor(frame,yframe,CV_RGB_YCrCb); // converting to YCbCr color space
extractChannel(yframe, yframe, 0); // extracting the Y channel
cv::minMaxLoc(yframe,&minV,&maxV,&min,&max);
cv::threshold(outf,outf,(maxV-10),(maxV),CV_THRESH_TOZERO);
/**
Now I want to use :
cv::rectangle()
but I want to draw a rect around any pixel (see the picture bellow)that's higher than (maxV-10)
and that during the streaming
**/
key = waitKey(1);
}
私が何をすべきかを理解するのに役立つように、この絵をホッピングして描きます。
ご協力いただきありがとうございます。