Skip to content

Commit d24b025

Browse files
committed
Merge pull request #2116 from sturkmen72:patch-3
2 parents 7bba4cf + 5e254cf commit d24b025

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

modules/ximgproc/samples/fld_lines.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ int main(int argc, char** argv)
2727
return -1;
2828
}
2929

30-
// Create LSD detector
31-
Ptr<LineSegmentDetector> lsd = createLineSegmentDetector();
32-
vector<Vec4f> lines_lsd;
33-
3430
// Create FLD detector
3531
// Param Default value Description
3632
// length_threshold 10 - Segments shorter than this will be discarded
@@ -57,29 +53,18 @@ int main(int argc, char** argv)
5753
vector<Vec4f> lines_fld;
5854

5955
// 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
6258
// CPU performance.
6359
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
6860
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-
7261
lines_fld.clear();
7362
int64 start = getTickCount();
7463
// Detect the lines with FLD
7564
fld->detect(image, lines_fld);
7665
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;
7867
}
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);
8368

8469
// Show found lines with FLD
8570
Mat line_image_fld(image);

0 commit comments

Comments
 (0)