Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you got this loop:

 for (Rect rect : faceDetections.toArray()) {
        // now, instead of writing the whole image to disk,
        // only write the (face) cropped  portion:
        Mat cropped = frame.subrect(rect);
        Highgui.imwrite("d:/capture6.jpg", cropped);
        // also, please do this, *before* drawing more stuff into 'frame'
       ...

you got this loop:

 for (Rect rect : faceDetections.toArray()) {
        // now, instead of writing the whole image to disk,
        // only write the (face) cropped  portion:
        Mat cropped = frame.subrect(rect);
frame.submat(rect);
        Highgui.imwrite("d:/capture6.jpg", cropped);
        // also, please do this, *before* drawing more stuff into 'frame'
       ...