Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

well, the latentsvm detector (in 3.0) was slow as molasses, but ...

image description

(works nice with sitting people as well.) well oh, it was moved out of 3.0 along with the softcascades and the contrib module. just in case, you still want to try it:

    vector<String> fn(1,"person.xml"); // from opencv_extra/cv
    LatentSvmDetector late;
    bool ok = late.load(fn);
    //resize(m,m,Size(m.cols*2/3,m.rows*2/3)); // does not detect
    //Mat g; cvtColor(m,g,COLOR_BGR2GRAY);     // throws, it actually wants color !
    vector<LatentSvmDetector::ObjectDetection> dets;
    late.detect(m,dets,0.2f);
    cerr << "frame " << frameid << ",  " << dets.size() << " detections." << endl;
    for (size_t i=0; i<dets.size(); ++i)
    {
        cerr << dets[i].classID << " " << dets[i].rect << " " << dets[i].score << endl;
        if (dets[i].score>0)
            rectangle(m,dets[i].rect,Scalar(0,200,0));
        else if (dets[i].score>-1.0)
            rectangle(m,dets[i].rect,Scalar(0,0,200));
    }

again, the main takeaway seems to me, that this one was trained on the PASCAL/VOC data, while the hog descriptors/cascades used the inria and daimler set.

if you need more poses covered, your train data has to be more diverse.

well, the latentsvm detector (in 3.0) was slow as molasses, but ...

image description

(works nice with sitting people as well.) well oh, it was moved out of 3.0 along with the softcascades and the contrib module. well.)

just in case, you still want to try it:it (get the person.xml first):

    vector<String> fn(1,"person.xml"); // from opencv_extra/cv
    LatentSvmDetector late;
    bool ok = late.load(fn);
    //resize(m,m,Size(m.cols*2/3,m.rows*2/3)); // does not detect
    //Mat g; cvtColor(m,g,COLOR_BGR2GRAY);     // throws, it actually wants color !
    vector<LatentSvmDetector::ObjectDetection> dets;
    late.detect(m,dets,0.2f);
    cerr << "frame " << frameid << ",  " << dets.size() << " detections." << endl;
    for (size_t i=0; i<dets.size(); ++i)
    {
        cerr << dets[i].classID << " " << dets[i].rect << " " << dets[i].score << endl;
        if (dets[i].score>0)
            rectangle(m,dets[i].rect,Scalar(0,200,0));
        else if (dets[i].score>-1.0)
            rectangle(m,dets[i].rect,Scalar(0,0,200));
    }

again, the main takeaway seems to me, that this one was trained on the PASCAL/VOC data, while the hog descriptors/cascades used the inria and daimler set.

if you need more poses covered, your train data has to be more diverse.

well, the latentsvm detector was slow as molasses, but ...

image description

(works nice with sitting people as well.)

just in case, you still want to try it (get the person.xml first):

    vector<String> fn(1,"person.xml"); // from opencv_extra/cv
    LatentSvmDetector late;
    bool ok = late.load(fn);
    //resize(m,m,Size(m.cols*2/3,m.rows*2/3)); // does not detect
    //Mat g; cvtColor(m,g,COLOR_BGR2GRAY);     // throws, it actually wants color !
    vector<LatentSvmDetector::ObjectDetection> dets;
    late.detect(m,dets,0.2f);
    cerr << "frame " << frameid << ",  " << dets.size() << " detections." << endl;
    for (size_t i=0; i<dets.size(); ++i)
    {
        cerr << dets[i].classID << " " << dets[i].rect << " " << dets[i].score << endl;
        if (dets[i].score>0)
            rectangle(m,dets[i].rect,Scalar(0,200,0));
        else if (dets[i].score>-1.0)
            rectangle(m,dets[i].rect,Scalar(0,0,200));
    }

again, the main takeaway seems to me, that this one was trained on the PASCAL/VOC data, while the hog descriptors/cascades used the inria and daimler set.

if you need more poses covered, your train data has to be more diverse.