Ask Your Question

chrathan's profile - activity

2016-03-22 10:21:30 -0600 received badge  Student (source)
2015-06-17 02:55:48 -0600 commented question Bounding box with grabCut

Basically grabCut return a black n white image. How can I take the limit values of the whites which corresponds to foreground?

2015-06-17 02:30:47 -0600 asked a question Bounding box with grabCut

I am using hogpedestrians cascade in order to calculate body in an image. I want to implement grabCut algorithm in order to restrict bounding box using grabCut implementation. I am using the following code:

        // GrabCut segmentation
        cv::grabCut(image,    // input image
            result,   // segmentation result
            BBox.at(0),// rectangle containing foreground  of body detector
            bgModel,fgModel, // models
            10,        // number of iterations
            cv::GC_INIT_WITH_RECT); // use rectangle
        // Get the pixels marked as likely foreground
        cv::compare(result,cv::GC_PR_FGD,result,cv::CMP_EQ);

The result of the grabcut segmentation is foreground and background pixels. How can I restrict my initial bounding box calculated with cascades using the result of grabCut? EDIT: the result of grabcut is result mat which contains the foreground pixels and the background pixels are black. How can I take the bounding box of the foreground pixels using result Mat file?

2015-05-20 01:54:50 -0600 commented question Implementation of GrabCut algorithm using face detection

Ok I got it. However is there any implementation in which I can get the body using grabCut? I mean something like that http://docs.opencv.org/3.0-beta/doc/p...

2015-05-19 09:43:50 -0600 commented question Implementation of GrabCut algorithm using face detection

Yes sometimes the body does not take straightforward poses. Therefore it is not the best idea to calculate the boundingbox using the face. I want to calculate the boundingbox using grabcut and the face as input to grabCut algorithm.

2015-05-19 09:28:33 -0600 received badge  Editor (source)
2015-05-19 09:04:15 -0600 asked a question 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 area of the foreground( my body in that case)?