Mercurial Hosting > traffic-intelligence
annotate include/cvutils.hpp @ 131:3a11dba30655
added colors
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 17 Aug 2011 19:03:11 -0400 |
parents | 536510f60854 |
children | 47329bd16cc0 |
rev | line source |
---|---|
9 | 1 #ifndef CVUTILS_HPP |
2 #define CVUTILS_HPP | |
3 | |
126
336926453b28
added conversion function from keypoint vector to point vector and cleaned headers
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
70
diff
changeset
|
4 #include "opencv2/core/core.hpp" |
336926453b28
added conversion function from keypoint vector to point vector and cleaned headers
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
70
diff
changeset
|
5 #include "opencv2/features2d/features2d.hpp" |
9 | 6 |
12
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
7 class CvCapture; |
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
8 |
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
9 /// constant that indicates if the image should be flipped |
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
10 //static const int flipImage = CV_CVTIMG_FLIP; |
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
11 |
128
536510f60854
new features generated as needed
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
127
diff
changeset
|
12 void keyPoints2Points(const std::vector<cv::KeyPoint>& kpts, std::vector<cv::Point2f>& pts, const bool& clearPts = true); |
126
336926453b28
added conversion function from keypoint vector to point vector and cleaned headers
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
70
diff
changeset
|
13 |
12
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
14 /** Allocates a new IplImage. */ |
9 | 15 IplImage* allocateImage(const int& width, const int& height, const int& depth, const int& channels); |
16 | |
17 IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels); | |
18 | |
12
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
19 /** Goes to the target frame number, by querying frame, |
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
20 supposing the video input is currently at current frame number. |
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
21 Returns the frame number that was reached.*/ |
ff5403319cec
optical flow demo working
Nicolas Saunier <nico@confins.net>
parents:
11
diff
changeset
|
22 int goToFrameNum(CvCapture* inputVideo, const int& currentFrameNum, const int& targetFrameNum); |
11
e77e2fd69b02
modularized code (not compiling)
Nicolas Saunier <nico@confins.net>
parents:
9
diff
changeset
|
23 |
131 | 24 /// Pre-defined colors |
25 class Colors { | |
26 public: | |
27 static const int nColors = 8; | |
28 static const cv::Scalar color[]; | |
29 | |
30 static cv::Scalar black(void); | |
31 static cv::Scalar red(void); | |
32 static cv::Scalar green(void); | |
33 static cv::Scalar blue(void); | |
34 static cv::Scalar white(void); | |
35 static cv::Scalar magenta(void); | |
36 static cv::Scalar cyan(void); | |
37 static cv::Scalar yellow(void); | |
38 | |
39 /** Maps integers to primary colors. */ | |
40 static cv::Scalar color3(const int& num); | |
41 static cv::Scalar color8(const int& num); | |
42 }; | |
43 | |
9 | 44 #endif |