Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
5e254cff
Unverified
Commit
5e254cff
authored
May 17, 2019
by
Suleyman TURKMEN
Committed by
GitHub
May 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update fld_lines.cpp
parent
7bba4cf0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
18 deletions
+3
-18
fld_lines.cpp
modules/ximgproc/samples/fld_lines.cpp
+3
-18
No files found.
modules/ximgproc/samples/fld_lines.cpp
View file @
5e254cff
...
...
@@ -27,10 +27,6 @@ int main(int argc, char** argv)
return
-
1
;
}
// Create LSD detector
Ptr
<
LineSegmentDetector
>
lsd
=
createLineSegmentDetector
();
vector
<
Vec4f
>
lines_lsd
;
// Create FLD detector
// Param Default value Description
// length_threshold 10 - Segments shorter than this will be discarded
...
...
@@ -57,29 +53,18 @@ int main(int argc, char** argv)
vector
<
Vec4f
>
lines_fld
;
// Because of some CPU's power strategy, it seems that the first running of
// an algorithm takes much longer. So here we run
both of the algorithmes 10
// t
imes to see each
algorithm's processing time with sufficiently warmed-up
// an algorithm takes much longer. So here we run
the algorithm 10 times
// t
o see the
algorithm's processing time with sufficiently warmed-up
// CPU performance.
for
(
int
run_count
=
0
;
run_count
<
10
;
run_count
++
)
{
lines_lsd
.
clear
();
int64
start_lsd
=
getTickCount
();
lsd
->
detect
(
image
,
lines_lsd
);
// Detect the lines with LSD
double
freq
=
getTickFrequency
();
double
duration_ms_lsd
=
double
(
getTickCount
()
-
start_lsd
)
*
1000
/
freq
;
std
::
cout
<<
"Elapsed time for LSD: "
<<
duration_ms_lsd
<<
" ms."
<<
std
::
endl
;
lines_fld
.
clear
();
int64
start
=
getTickCount
();
// Detect the lines with FLD
fld
->
detect
(
image
,
lines_fld
);
double
duration_ms
=
double
(
getTickCount
()
-
start
)
*
1000
/
freq
;
std
::
cout
<<
"E
al
psed time for FLD "
<<
duration_ms
<<
" ms."
<<
std
::
endl
;
std
::
cout
<<
"E
la
psed time for FLD "
<<
duration_ms
<<
" ms."
<<
std
::
endl
;
}
// Show found lines with LSD
Mat
line_image_lsd
(
image
);
lsd
->
drawSegments
(
line_image_lsd
,
lines_lsd
);
imshow
(
"LSD result"
,
line_image_lsd
);
// Show found lines with FLD
Mat
line_image_fld
(
image
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment