Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the "minimal" args to construct a Keypoint are x,y,size. you'll just have to invent a size, that makes sense in your image (e.g avg. distance between points).

vector<point> pts = .... ; // from landmarks or such vector<keypoint> kp; // empty float s = 5; // ?? for (size_t i=0; i<pts.size(); i++)="" {="" kp.push_back(pts[i].x,="" pts[i].y,="" s);="" }<="" p="">

Mat descriptors; Ptr<feature2d> extractor = features2d::SURF::create(); // you need float features for the svm ! extractor->compute(image, kp, descriptors);

the "minimal" args to construct a Keypoint are x,y,size. you'll just have to invent a size, that makes sense in your image (e.g avg. distance between points).

vector<point>

vector<Point> pts = .... ; // from landmarks or such
vector<keypoint> vector<KeyPoint> kp; // empty
float s = 5; // ??
for (size_t i=0; i<pts.size(); i++)="" {="" kp.push_back(pts[i].x,="" pts[i].y,="" s);="" }<="" p="">
i++)
{
    kp.push_back(pts[i].x, pts[i].y, s);
}
 

Mat descriptors; Ptr<feature2d> Ptr<Feature2D> extractor = features2d::SURF::create(); // you need float features for the svm ! extractor->compute(image, kp, descriptors);

descriptors);