Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Implementation of GrabCut algorithm using face detection

I want to create a body detection software for images using grabCut opencv c++ implementation. I have already the position of faces in the images. Therefore I want to use the information of image in order to caluclate the body bounding box using grabCut (in order to calculate the foreground). I am using the following imgproc implemenation of grabCut algorithm:

    cv::grabCut(image,    // input image
        result,   // segmentation result
        faces.at(0),// rectangle containing foreground 
        bgModel,fgModel, // models
        5,        // number of iterations
        cv::GC_INIT_WITH_RECT); // use rectangle

Where faces.at(0) the first face in the image. The result mask contain only area near the face. How can I get the whole containing are of the foreground( my body in that case)?

Implementation of GrabCut algorithm using face detection

I want to create a body detection software for images using grabCut opencv c++ implementation. I have already the position of faces in the images. Therefore I want to use the information of image in order to caluclate the body bounding box using grabCut (in order to calculate the foreground). I am using the following imgproc implemenation of grabCut algorithm:

    cv::grabCut(image,    // input image
        result,   // segmentation result
        faces.at(0),// rectangle containing foreground 
        bgModel,fgModel, // models
        5,        // number of iterations
        cv::GC_INIT_WITH_RECT); // use rectangle

Where faces.at(0) the first face in the image. The result mask contain only area near the face. How can I get the whole containing are area of the foreground( my body in that case)?