Mercurial Hosting > traffic-intelligence
annotate c/feature-based-tracking.cpp @ 123:df3bdd8e50ba
displays tracking from video and webcam
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 16 Aug 2011 00:46:22 -0400 |
parents | 654f1c748644 |
children | 1e68e18b1aa5 |
rev | line source |
---|---|
122
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
1 #include "Feature.hpp" |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
2 #include "utils.hpp" |
117
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
3 |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
4 #include "opencv2/highgui/highgui.hpp" |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
5 //#include "opencv2/imgproc/imgproc.hpp" |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
6 #include "opencv2/features2d/features2d.hpp" |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
7 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
8 #include <iostream> |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
9 //#include <list> |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
10 #include <vector> |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
11 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
12 using namespace std; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
13 using namespace cv; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
14 |
119
45a426552aaa
compilation of very simple feature class with trajectory
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
117
diff
changeset
|
15 //#include "cv.h" |
117
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
16 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
17 using namespace std; |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
18 |
123
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
19 void drawMatchesRelative(const vector<KeyPoint>& train, const vector<KeyPoint>& query, std::vector<cv::DMatch>& matches, Mat& img) { |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
20 for (int i = 0; i < (int)matches.size(); i++) |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
21 { |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
22 Point2f pt_new = query[matches[i].queryIdx].pt; |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
23 Point2f pt_old = train[matches[i].trainIdx].pt; |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
24 Point2f dist = pt_new - pt_old; |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
25 if (norm(dist) < 20) { |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
26 cv::line(img, pt_new, pt_old, Scalar(125, 255, 125), 1); |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
27 cv::circle(img, pt_new, 2, Scalar(255, 0, 125), 1); |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
28 } |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
29 } |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
30 } |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
31 |
117
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
32 int main(int argc, char *argv[]) { |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
33 |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
34 BriefDescriptorExtractor brief(32); |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
35 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
36 VideoCapture capture; |
122
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
37 |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
38 Mat frame, display; |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
39 |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
40 if( argc == 1 || (argc == 2 && strlen(argv[1]) == 1 && isdigit(argv[1][0]))) // if no parameter or number parameter |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
41 capture.open(argc == 2 ? argv[1][0] - '0' : 0); |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
42 else if( argc >= 2 ) |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
43 { |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
44 capture.open(argv[1]); |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
45 if( capture.isOpened() ) |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
46 cout << "Video " << argv[1] << |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
47 ": width=" << capture.get(CV_CAP_PROP_FRAME_WIDTH) << |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
48 ", height=" << capture.get(CV_CAP_PROP_FRAME_HEIGHT) << |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
49 ", nframes=" << capture.get(CV_CAP_PROP_FRAME_COUNT) << endl; |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
50 if( argc > 2 && isdigit(argv[2][0]) ) // could be used to reach first frame, dumping library messages to log file (2> /tmp/log.txt) |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
51 { |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
52 int pos; |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
53 sscanf(argv[2], "%d", &pos); |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
54 cout << "seeking to frame #" << pos << endl; |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
55 //cap.set(CV_CAP_PROP_POS_FRAMES, pos); |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
56 for (int i=0; i<pos; i++) |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
57 capture >> frame; |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
58 } |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
59 } |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
60 |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
61 // capture.open(atoi(argv[1])); |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
62 if (!capture.isOpened()) |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
63 { |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
64 //help(argv); |
122
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
65 cout << "capture device " << argv[1] << " failed to open!" << endl; |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
66 return 1; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
67 } |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
68 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
69 vector<DMatch> matches; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
70 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
71 BruteForceMatcher<Hamming> desc_matcher; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
72 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
73 vector<Point2f> train_pts, query_pts; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
74 vector<KeyPoint> train_kpts, query_kpts; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
75 vector<unsigned char> match_mask; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
76 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
77 Mat gray; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
78 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
79 Mat train_desc, query_desc; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
80 const int DESIRED_FTRS = 500; |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
81 GridAdaptedFeatureDetector detector(new FastFeatureDetector(10, true), DESIRED_FTRS, 4, 4); |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
82 |
122
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
83 int frameNum = 0; |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
84 for (;;) |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
85 { |
123
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
86 frameNum++; |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
87 //capture.set(CV_CAP_PROP_POS_FRAMES, frameNum); |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
88 //capture.grab();capture.grab();capture.retrieve(frame); |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
89 capture >> frame; |
123
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
90 //cout << capture.get(CV_CAP_PROP_POS_FRAMES) << endl; |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
91 while (frame.empty()) |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
92 capture >> frame;//break; |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
93 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
94 cvtColor(frame, gray, CV_RGB2GRAY); |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
95 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
96 detector.detect(gray, query_kpts); //Find interest points |
123
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
97 cout << query_kpts.size() << " kpts" << endl; |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
98 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
99 brief.compute(gray, query_kpts, query_desc); //Compute brief descriptors at each keypoint location |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
100 |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
101 // find how keypoints descriptions are matched to previous ones (in train kpts probably) |
123
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
102 //display = frame.clone(); |
122
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
103 if (!train_kpts.empty()) |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
104 { |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
105 desc_matcher.match(query_desc, train_desc, matches); |
123
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
106 cout << "matches:" << matches.size() << endl; |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
107 drawMatchesRelative(train_kpts, query_kpts, matches, frame); |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
108 //drawMatches(frame, train_kpts, frame, query_kpts, matches, display);//, Scalar::all(-1), Scalar::all(-1), vector<vector<char> >(), DrawMatchesFlags::DRAW_OVER_OUTIMG); |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
109 } |
122
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
110 |
123
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
111 imshow("frame", frame); |
122
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
112 train_kpts = query_kpts; |
123
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
113 query_desc.copyTo(train_desc); |
df3bdd8e50ba
displays tracking from video and webcam
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
122
diff
changeset
|
114 int key = waitKey(5); |
122
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
115 if (::interruptionKey(key)) |
654f1c748644
work on displaying matched features
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
121
diff
changeset
|
116 break; |
121
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
117 } |
c4d4b5b93add
copied the video_homography opencv sample
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
119
diff
changeset
|
118 |
119
45a426552aaa
compilation of very simple feature class with trajectory
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
117
diff
changeset
|
119 Feature f; |
45a426552aaa
compilation of very simple feature class with trajectory
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
117
diff
changeset
|
120 |
117
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
121 return 0; |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
122 } |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
123 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
124 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
125 /* ------------------ DOCUMENTATION ------------------ */ |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
126 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
127 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
128 /*! \mainpage |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
129 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
130 This project is a collection of software tools for transportation called Traffic Intelligence. Other documents are: |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
131 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
132 - \ref feature_based_tracking |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
133 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
134 The code is partially self-described using the doxygen tool and comment formatting. The documentation can be extracted using doxygen, typing \c doxygen in the main directory (or <tt>make doc</tt> on a system with the Makefile tool installed). |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
135 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
136 */ |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
137 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
138 /*! \page feature_based_tracking Feature-based Tracking: User Manual |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
139 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
140 This document describes a software tool for object tracking in video data, developed for road traffic monitoring and safety diagnosis. It is part of a larger collection of software tools for transportation called Traffic Intelligence. |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
141 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
142 The tool relies on feature-based tracking, a robust object tracking methods, particularly suited for the extraction of traffic data such as trajectories and speeds. The best description of this method is given in <a href="http://nicolas.saunier.confins.net/data/saunier06crv.html">this paper</a>. The program has a command line interface and this document will shortly explain how to use the tool. Keep in mind this is a work in progress and major changes are continuously being made. |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
143 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
144 \section License |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
145 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
146 The code is licensed under the MIT open source license (http://www.opensource.org/licenses/mit-license). |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
147 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
148 If you make use of this piece of software, please cite one of my paper, e.g. N. Saunier, T. Sayed and K. Ismail. Large Scale Automated Analysis of Vehicle Interactions and Collisions. Transportation Research Record: Journal of the Transportation Research Board, 2147:42-50, 2010. I would be very happy in any case to know about any use of the code, and to discuss any opportunity for collaboration. |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
149 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
150 Contact me at nicolas.saunier@polymtl.ca and learn more about my work at http://nicolas.saunier.confins.net. |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
151 |
fea680fb03ee
created main feature based tracking file and minimum doxygen documentation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
152 */ |