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
694d9ff2
Commit
694d9ff2
authored
Jul 15, 2013
by
Daniel Angelov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LSD enum now anonymous.
parent
d3560120
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
imgproc.hpp
modules/imgproc/include/opencv2/imgproc.hpp
+7
-8
lsd.cpp
modules/imgproc/src/lsd.cpp
+8
-8
No files found.
modules/imgproc/include/opencv2/imgproc.hpp
View file @
694d9ff2
...
...
@@ -192,8 +192,7 @@ enum { HOUGH_STANDARD = 0,
};
//! Variants of Line Segment Detector
enum
lsd_refine_lvl
{
LSD_REFINE_NONE
=
0
,
enum
{
LSD_REFINE_NONE
=
0
,
LSD_REFINE_STD
=
1
,
LSD_REFINE_ADV
=
2
};
...
...
@@ -844,10 +843,10 @@ public:
* Create an LSD object. Specifying scale, number of subdivisions for the image, should the lines be refined and other constants as follows:
*
* @param _refine How should the lines found be refined?
* REFINE_NONE - No refinement applied.
* REFINE_STD - Standard refinement is applied. E.g. breaking arches into smaller line approximations.
* REFINE_ADV - Advanced refinement. Number of false alarms is calculated,
* lines are refined through increase of precision, decrement in size, etc.
*
LSD_
REFINE_NONE - No refinement applied.
*
LSD_
REFINE_STD - Standard refinement is applied. E.g. breaking arches into smaller line approximations.
*
LSD_
REFINE_ADV - Advanced refinement. Number of false alarms is calculated,
*
lines are refined through increase of precision, decrement in size, etc.
* @param _scale The scale of the image that will be used to find the lines. Range (0..1].
* @param _sigma_scale Sigma for Gaussian filter is computed as sigma = _sigma_scale/_scale.
* @param _quant Bound to the quantization error on the gradient norm.
...
...
@@ -856,7 +855,7 @@ public:
* @param _density_th Minimal density of aligned region points in rectangle.
* @param _n_bins Number of bins in pseudo-ordering of gradient modulus.
*/
LSD
(
lsd_refine_lvl
_refine
=
LSD_REFINE_STD
,
double
_scale
=
0.8
,
LSD
(
int
_refine
=
LSD_REFINE_STD
,
double
_scale
=
0.8
,
double
_sigma_scale
=
0.6
,
double
_quant
=
2.0
,
double
_ang_th
=
22.5
,
double
_log_eps
=
0
,
double
_density_th
=
0.7
,
int
_n_bins
=
1024
);
...
...
@@ -919,7 +918,7 @@ private:
int
roix
,
roiy
;
const
double
SCALE
;
const
lsd_refine_lvl
doRefine
;
const
int
doRefine
;
const
double
SIGMA_SCALE
;
const
double
QUANT
;
const
double
ANG_TH
;
...
...
modules/imgproc/src/lsd.cpp
View file @
694d9ff2
...
...
@@ -39,10 +39,10 @@
//
//M*/
#include <vector>
#include "precomp.hpp"
#include <vector>
using
namespace
cv
;
/////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -163,7 +163,7 @@ inline double log_gamma_lanczos(const double& x)
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
LSD
::
LSD
(
lsd_refine_lvl
_refine
,
double
_scale
,
double
_sigma_scale
,
double
_quant
,
LSD
::
LSD
(
int
_refine
,
double
_scale
,
double
_sigma_scale
,
double
_quant
,
double
_ang_th
,
double
_log_eps
,
double
_density_th
,
int
_n_bins
)
:
SCALE
(
_scale
),
doRefine
(
_refine
),
SIGMA_SCALE
(
_sigma_scale
),
QUANT
(
_quant
),
ANG_TH
(
_ang_th
),
LOG_EPS
(
_log_eps
),
DENSITY_TH
(
_density_th
),
N_BINS
(
_n_bins
)
...
...
@@ -201,9 +201,9 @@ void LSD::detect(const cv::InputArray _image, cv::OutputArray _lines, cv::Rect _
flsd
(
lines
,
w
,
p
,
n
);
Mat
(
lines
).
copyTo
(
_lines
);
if
(
w
)
Mat
(
*
w
).
copyTo
(
_width
);
if
(
p
)
Mat
(
*
p
).
copyTo
(
_prec
);
if
(
n
)
Mat
(
*
n
).
copyTo
(
_nfa
);
if
(
w
)
Mat
(
*
w
).
copyTo
(
_width
);
if
(
p
)
Mat
(
*
p
).
copyTo
(
_prec
);
if
(
n
)
Mat
(
*
n
).
copyTo
(
_nfa
);
delete
w
;
delete
p
;
...
...
@@ -220,7 +220,7 @@ void LSD::flsd(std::vector<Vec4i>& lines,
const
double
rho
=
QUANT
/
sin
(
prec
);
// gradient magnitude threshold
std
::
vector
<
coorlist
>
list
;
if
(
SCALE
!=
1
)
if
(
SCALE
!=
1
)
{
Mat
gaussian_img
;
const
double
sigma
=
(
SCALE
<
1
)
?
(
SIGMA_SCALE
/
SCALE
)
:
(
SIGMA_SCALE
);
...
...
@@ -357,7 +357,7 @@ void LSD::ll_angle(const double& threshold, const unsigned int& n_bins, std::vec
}
else
{
angles_data
[
addr
]
=
double
(
cv
::
fastAtan2
(
gx
,
-
gy
))
*
DEG_TO_RADS
;
// gradient angle computation
angles_data
[
addr
]
=
cv
::
fastAtan2
(
float
(
gx
),
float
(
-
gy
))
*
DEG_TO_RADS
;
// gradient angle computation
if
(
norm
>
max_grad
)
{
max_grad
=
norm
;
}
}
...
...
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