Ask Your Question

Revision history [back]

opencv cature video roi

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;; namedWindow("window", CV_WINDOW_AUTOSIZE);

while(1) {

// This do not work

imshow("window", image2);

// This works

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

waitKey(10); }

return 0; }