Пример #1
0
void mat2KpVec(const Mat_d& matPts , KpVec& vecPts) {
	int numPts = matPts.rows;
	vecPts.reserve(numPts);
	for (int i = 0; i < numPts; i++) {
		double x = matPts.data[2 * i];
		double y = matPts.data[2 * i + 1];

		cv::KeyPoint pt(x, y, 1);
		vecPts.push_back(pt);
	}
}
Пример #2
0
void KpVec2Mat(const KpVec& vecPts , Mat_d& matPts) {
	int numPts = vecPts.size();
	matPts.resize(numPts, 2);
	for (int i = 0; i < numPts; i++) {
		matPts.data[2 * i] = vecPts[i].pt.x;
		matPts.data[2 * i + 1] = vecPts[i].pt.y;
	}
}
Пример #3
0
void DepthPIRF::FAST(IplImage& img,KpVec& FeatureVec)
{
    FastFeatureDetector detector(50);

    detector.detect( Mat(&img), FeatureVec );

    for(int i=0;i<FeatureVec.size();i++) FeatureVec[i].class_id=i;
}