torrvision / Objectness

BING Objectness proposal estimator linux/mac/windows version implementation, runs at 1000 FPS. More in http://mmcheng.net/bing/ and also http://www.robots.ox.ac.uk/~szheng/DepthProposals.html
http://kylezheng.org/objectproposal/
BSD 3-Clause "New" or "Revised" License
190 stars 86 forks source link

OpenCV 3.0 Objectness #3

Open llnk opened 10 years ago

llnk commented 10 years ago

Hi,

It seems that OpenCV 3.0 will include BING Objectness: http://docs.opencv.org/trunk/modules/saliency/doc/objectness_algorithms.html

Until then, I wonder if it is availabe an already trained and ready-to-work BING function to get all bounding boxes inside a single frame (without having to download VOC dataset and perform the training)?

llnk commented 10 years ago

It seems I have found the right method to detect the object in a single frame. I wrote this code that calls "getObjBndBoxes()" method:

    srand((unsigned int)time(NULL));
    DataSetVOC voc2007("./VOC2007/");
    voc2007.loadAnnotations();
    //voc2007.loadDataGenericOverCls();

    printf("Dataset:`%s' with %d training and %d testing\n", _S(voc2007.wkDir), voc2007.trainNum, voc2007.testNum);
    printf("%s Base = %g, W = %d, NSS = %d, perSz = %d\n", _S(resName), base, W, NSS, numPerSz);

    Objectness objNess(voc2007, base, W, NSS);

    ValStructVec<float, Vec4i> bboxes;

    Mat query = imread("./VOC2007/JPEGImages/008038.jpg");
    objNess.trainObjectness(100);
    objNess.loadTrainedModel();
    objNess.getObjBndBoxes(query, bboxes, 100);

    for (int i = 0; i < bboxes.size(); i++){
        Rect current(Point2i(bboxes[i][0], bboxes[i][1]), Point2i(bboxes[i][2], bboxes[i][3]));
        rectangle(query, current, Scalar(255,0,0),3);
        imshow("query", query);
        waitKey(0);
    }

The problem is that this method returns too many bounding boxes.. Is there anyway to select just the bounding box of the people and other important object?

I have uploaded the result of BING with all bounding boxes (manually limited to 50)

bingresults

How can I select only the bounding boxes on the people?

bittnt commented 10 years ago

Sorry to reply late. Thanks for providing a possible solution to this.

You might get just the bounding box of the people and other important object by applying a simple classifier on top of the boundingbox, e.g. frontal face classifier (already in OpenCV).

On Wed, Sep 17, 2014 at 7:04 PM, llnk notifications@github.com wrote:

It seems I have found the right method to detect the object in a single frame. I wrote this code that calls "getObjBndBoxes()" method:

srand((unsigned int)time(NULL));
DataSetVOC voc2007("./VOC2007/");
voc2007.loadAnnotations();
//voc2007.loadDataGenericOverCls();

printf("Dataset:`%s' with %d training and %d testing\n", _S(voc2007.wkDir), voc2007.trainNum, voc2007.testNum);
printf("%s Base = %g, W = %d, NSS = %d, perSz = %d\n", _S(resName), base, W, NSS, numPerSz);

Objectness objNess(voc2007, base, W, NSS);

ValStructVec<float, Vec4i> bboxes;

Mat query = imread("./VOC2007/JPEGImages/008038.jpg");
objNess.trainObjectness(100);
objNess.loadTrainedModel();
objNess.getObjBndBoxes(query, bboxes, 100);

for (int i = 0; i < bboxes.size(); i++){
    Rect current(Point2i(bboxes[i][0], bboxes[i][1]), Point2i(bboxes[i][2], bboxes[i][3]));
    rectangle(query, current, Scalar(255,0,0),3);
    imshow("query", query);
    waitKey(0);
}

The problem is that this method returns too many bounding boxes.. Is there anyway to select just the bounding box of the people and other important object?

I have uploaded the result of BING with all bounding boxes

[image: bingresults] https://cloud.githubusercontent.com/assets/1444881/4302470/53e2c544-3e5a-11e4-892b-5fd25c4e1d16.png

— Reply to this email directly or view it on GitHub https://github.com/bittnt/Objectness/issues/3#issuecomment-55878727.

郑帅 Shuai Zheng (Kyle) http://kylezheng.org/