Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

rule of thumb: if you're witing for-loops with pixels, you're doing it wrong.

please use a ROI and setTo() to achieve this, like:

frame(Rect(0,0,180,180)).setTo(Scalar(0,0,255));

rule of thumb: if you're witing for-loops with pixels, you're doing it wrong.

please use a ROI and setTo() to achieve this, like:

frame(Rect(0,0,180,180)).setTo(Scalar(0,0,255));
Rect r = Rect(0,0,180,180) & Rect(0,0,frame.cols,frame.rows); // make sure, we fit into the frame
frame(r).setTo(Scalar(0,0,255));

rule of thumb: if you're witing for-loops with pixels, you're doing it wrong.

please use a ROI and setTo() to achieve this, like:

Rect r = Rect(0,0,180,180) & Rect(0,0,180,180); // our desired ROI
r &= Rect(0,0,frame.cols,frame.rows); // make sure, we fit into the frame
//crop to frame, if nessecary !
frame(r).setTo(Scalar(0,0,255));

rule of thumb: if you're witing for-loops with pixels, you're doing it wrong.

please use a ROI and setTo() to achieve this, like:

Rect r = Rect(0,0,180,180); // our desired ROI
r &= Rect(0,0,frame.cols,frame.rows); //crop to frame, frame size, if nessecary !
frame(r).setTo(Scalar(0,0,255));

rule of thumb: if you're witing writing for-loops with pixels, you're doing it wrong.

please use a ROI and setTo() to achieve this, like:

Rect r = Rect(0,0,180,180); // our desired ROI
r &= Rect(0,0,frame.cols,frame.rows); //crop to frame size, if nessecary !
frame(r).setTo(Scalar(0,0,255));

rule of thumb: if you're writing for-loops with pixels, you're doing it wrong.

either you type (Vec3b) does not match the image, or your assumption about the size (does 180 fit in?) does not match.

please use a ROI and setTo() to achieve this, like:

Rect r = Rect(0,0,180,180); // our desired ROI
r &= Rect(0,0,frame.cols,frame.rows); //crop to frame size, if nessecary !
frame(r).setTo(Scalar(0,0,255));