Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV 3.0 Objectness #3

Open
llnk opened this issue Sep 16, 2014 · 2 comments
Open

OpenCV 3.0 Objectness #3

llnk opened this issue Sep 16, 2014 · 2 comments

Comments

@llnk
Copy link

llnk commented Sep 16, 2014

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
Copy link
Author

llnk commented Sep 17, 2014

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
Copy link
Collaborator

bittnt commented Sep 19, 2014

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 [email protected] 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
#3 (comment).

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants