@@ -27,10 +27,6 @@ int main(int argc, char** argv)
27
27
return -1 ;
28
28
}
29
29
30
- // Create LSD detector
31
- Ptr<LineSegmentDetector> lsd = createLineSegmentDetector ();
32
- vector<Vec4f> lines_lsd;
33
-
34
30
// Create FLD detector
35
31
// Param Default value Description
36
32
// length_threshold 10 - Segments shorter than this will be discarded
@@ -57,29 +53,18 @@ int main(int argc, char** argv)
57
53
vector<Vec4f> lines_fld;
58
54
59
55
// Because of some CPU's power strategy, it seems that the first running of
60
- // an algorithm takes much longer. So here we run both of the algorithmes 10
61
- // times to see each algorithm's processing time with sufficiently warmed-up
56
+ // an algorithm takes much longer. So here we run the algorithm 10 times
57
+ // to see the algorithm's processing time with sufficiently warmed-up
62
58
// CPU performance.
63
59
for (int run_count = 0 ; run_count < 10 ; run_count++) {
64
- lines_lsd.clear ();
65
- int64 start_lsd = getTickCount ();
66
- lsd->detect (image, lines_lsd);
67
- // Detect the lines with LSD
68
60
double freq = getTickFrequency ();
69
- double duration_ms_lsd = double (getTickCount () - start_lsd) * 1000 / freq;
70
- std::cout << " Elapsed time for LSD: " << duration_ms_lsd << " ms." << std::endl;
71
-
72
61
lines_fld.clear ();
73
62
int64 start = getTickCount ();
74
63
// Detect the lines with FLD
75
64
fld->detect (image, lines_fld);
76
65
double duration_ms = double (getTickCount () - start) * 1000 / freq;
77
- std::cout << " Ealpsed time for FLD " << duration_ms << " ms." << std::endl;
66
+ std::cout << " Elapsed time for FLD " << duration_ms << " ms." << std::endl;
78
67
}
79
- // Show found lines with LSD
80
- Mat line_image_lsd (image);
81
- lsd->drawSegments (line_image_lsd, lines_lsd);
82
- imshow (" LSD result" , line_image_lsd);
83
68
84
69
// Show found lines with FLD
85
70
Mat line_image_fld (image);
0 commit comments