Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

so the answer is: use copyTo() with a mask (and a roi):

Rect roi = // something based on hinfo
img(roi).copyTo(patch1, mask==255);

please try to use opencv's builtin functions, not to defeat it writing ill fated for-loops, like above !

so the answer is: use copyTo() with a mask (and a roi):

Rect roi = // something based on hinfo
img(roi).copyTo(patch1, mask==255);
mask);

please try to use opencv's builtin functions, not to defeat it writing ill fated for-loops, like above !