comparison c/cvutils.cpp @ 126:336926453b28

added conversion function from keypoint vector to point vector and cleaned headers
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 17 Aug 2011 00:20:31 -0400
parents ff5403319cec
children d19d6e63dd77
comparison
equal deleted inserted replaced
125:28907fde9855 126:336926453b28
1 #include "cvutils.hpp" 1 #include "cvutils.hpp"
2 2
3 #include "opencv/cv.h" 3 //#include "opencv/cv.h"
4 #include "opencv/highgui.h" 4 #include "opencv2/highgui/highgui.hpp"
5 #include "opencv2/features2d/features2d.hpp"
5 6
6 #include <iostream> 7 #include <iostream>
8 #include <vector>
7 9
8 using namespace std; 10 using namespace std;
11 using namespace cv;
12
13 void keypPoints2Points(const vector<KeyPoint>& kpts, vector<Point2f>& points) {
14 points.clear();
15 points.resize(kpts.size());
16
17 for (unsigned int i=0; i<kpts.size(); i++)
18 points[i] = kpts[i].pt;
19 }
9 20
10 IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels) { return ::allocateImage(cvSize(width, height), depth, channels);} 21 IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels) { return ::allocateImage(cvSize(width, height), depth, channels);}
11 22
12 IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels) { 23 IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels) {
13 IplImage* image = cvCreateImage(size, depth, channels); 24 IplImage* image = cvCreateImage(size, depth, channels);