Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You could use ROI(region of interest) to operate specific portion(rectangular) of Mat,

Assume you already detected face, and got face rect.

     Mat frame; // input frame
     Rect faceRect; //  face rectangle
     .....................
    //face detection
     .....................

     Now apply ROI
     Mat ROI=frame(faceRect); // here you got Mat with face portion, note that any change made on ROI will change the original Mat, that is frame, as it's not a deep copy operation and that's what you required.

    // blur ROI or any do any  other operation
    .............................................