Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
47b6955b
Commit
47b6955b
authored
Mar 01, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13942 from alalek:imgproc_lsd
parents
f0179f96
3ba49cce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
78 deletions
+9
-78
imgproc.hpp
modules/imgproc/include/opencv2/imgproc.hpp
+5
-5
lsd.cpp
modules/imgproc/src/lsd.cpp
+0
-0
test_lsd.cpp
modules/imgproc/test/test_lsd.cpp
+4
-0
lsd_lines.cpp
samples/cpp/lsd_lines.cpp
+0
-73
No files found.
modules/imgproc/include/opencv2/imgproc.hpp
View file @
47b6955b
...
...
@@ -1211,14 +1211,12 @@ protected:
//! @addtogroup imgproc_feature
//! @{
/** @example samples/cpp/lsd_lines.cpp
An example using the LineSegmentDetector
\image html building_lsd.png "Sample output image" width=434 height=300
*/
/** @brief Line segment detector class
following the algorithm described at @cite Rafael12 .
@note Implementation has been removed due original code license conflict
*/
class
CV_EXPORTS_W
LineSegmentDetector
:
public
Algorithm
{
...
...
@@ -1282,6 +1280,8 @@ to edit those, as to tailor it for their own application.
is chosen.
@param _density_th Minimal density of aligned region points in the enclosing rectangle.
@param _n_bins Number of bins in pseudo-ordering of gradient modulus.
@note Implementation has been removed due original code license conflict
*/
CV_EXPORTS_W
Ptr
<
LineSegmentDetector
>
createLineSegmentDetector
(
int
_refine
=
LSD_REFINE_STD
,
double
_scale
=
0.8
,
...
...
modules/imgproc/src/lsd.cpp
View file @
47b6955b
This diff is collapsed.
Click to expand it.
modules/imgproc/test/test_lsd.cpp
View file @
47b6955b
...
...
@@ -5,6 +5,8 @@
namespace
opencv_test
{
namespace
{
#if 0 // LSD implementation has been removed due original code license issues
const Size img_size(640, 480);
const int LSD_TEST_SEED = 0x134679;
const int EPOCHS = 20;
...
...
@@ -402,4 +404,6 @@ TEST_F(Imgproc_LSD_Common, compareSegmentsVec4i)
ASSERT_EQ(result2, 11);
}
#endif
}}
// namespace
samples/cpp/lsd_lines.cpp
deleted
100644 → 0
View file @
f0179f96
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using
namespace
std
;
using
namespace
cv
;
int
main
(
int
argc
,
char
**
argv
)
{
cv
::
CommandLineParser
parser
(
argc
,
argv
,
"{input i|building.jpg|input image}"
"{refine r|false|if true use LSD_REFINE_STD method, if false use LSD_REFINE_NONE method}"
"{canny c|false|use Canny edge detector}"
"{overlay o|false|show result on input image}"
"{help h|false|show help message}"
);
if
(
parser
.
get
<
bool
>
(
"help"
))
{
parser
.
printMessage
();
return
0
;
}
parser
.
printMessage
();
String
filename
=
samples
::
findFile
(
parser
.
get
<
String
>
(
"input"
));
bool
useRefine
=
parser
.
get
<
bool
>
(
"refine"
);
bool
useCanny
=
parser
.
get
<
bool
>
(
"canny"
);
bool
overlay
=
parser
.
get
<
bool
>
(
"overlay"
);
Mat
image
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
if
(
image
.
empty
()
)
{
cout
<<
"Unable to load "
<<
filename
;
return
1
;
}
imshow
(
"Source Image"
,
image
);
if
(
useCanny
)
{
Canny
(
image
,
image
,
50
,
200
,
3
);
// Apply Canny edge detector
}
// Create and LSD detector with standard or no refinement.
Ptr
<
LineSegmentDetector
>
ls
=
useRefine
?
createLineSegmentDetector
(
LSD_REFINE_STD
)
:
createLineSegmentDetector
(
LSD_REFINE_NONE
);
double
start
=
double
(
getTickCount
());
vector
<
Vec4f
>
lines_std
;
// Detect the lines
ls
->
detect
(
image
,
lines_std
);
double
duration_ms
=
(
double
(
getTickCount
())
-
start
)
*
1000
/
getTickFrequency
();
std
::
cout
<<
"It took "
<<
duration_ms
<<
" ms."
<<
std
::
endl
;
// Show found lines
if
(
!
overlay
||
useCanny
)
{
image
=
Scalar
(
0
,
0
,
0
);
}
ls
->
drawSegments
(
image
,
lines_std
);
String
window_name
=
useRefine
?
"Result - standard refinement"
:
"Result - no refinement"
;
window_name
+=
useCanny
?
" - Canny edge detector used"
:
""
;
imshow
(
window_name
,
image
);
waitKey
();
return
0
;
}
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