opencv cature video roi

asked 2013-09-19 15:51:39 -0500

larst gravatar image

Want to capture upper left corner of frame from USB Webcam, whitout first have to capture entire frame. How can I do?

using namespace cv;

int main() { Mat image; Mat image2; VideoCapture cap; cap.open(0); namedWindow("window", CV_WINDOW_AUTOSIZE);

while(1) {

// This do not work

cap>>image2(Rect(0,0,10,20));
imshow("window", image2);

// This works

cap>>image;
image2=image(Rect(0,0,10,20)); imshow("window", image2);

waitKey(10); }

return 0; }

edit retag flag offensive close merge delete

Comments

stick with your 2nd approach. you can't do without capturing the whole thing first

berak gravatar imageberak ( 2013-09-19 16:05:05 -0500 )edit