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
3350533f
Commit
3350533f
authored
Jul 13, 2013
by
Daniel Angelov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ambiguouty error, signess compare.
parent
6bd5e12b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
lsd.cpp
modules/imgproc/src/lsd.cpp
+3
-3
test_lsd.cpp
modules/imgproc/test/test_lsd.cpp
+12
-12
No files found.
modules/imgproc/src/lsd.cpp
View file @
3350533f
...
@@ -135,7 +135,7 @@ inline bool AsmallerB_XoverY(const edge& a, const edge& b)
...
@@ -135,7 +135,7 @@ inline bool AsmallerB_XoverY(const edge& a, const edge& b)
inline
double
log_gamma_windschitl
(
const
double
&
x
)
inline
double
log_gamma_windschitl
(
const
double
&
x
)
{
{
return
0.918938533204673
+
(
x
-
0.5
)
*
log
(
x
)
-
x
return
0.918938533204673
+
(
x
-
0.5
)
*
log
(
x
)
-
x
+
0.5
*
x
*
log
(
x
*
sinh
(
1
/
x
)
+
1
/
(
810.0
*
pow
(
x
,
6.0
)));
+
0.5
*
x
*
log
(
x
*
sinh
(
1
/
x
)
+
1
/
(
810.0
*
pow
(
x
,
6.0
)));
}
}
/**
/**
...
@@ -221,7 +221,7 @@ void LSD::flsd(std::vector<Vec4i>& lines,
...
@@ -221,7 +221,7 @@ void LSD::flsd(std::vector<Vec4i>& lines,
Mat
gaussian_img
;
Mat
gaussian_img
;
const
double
sigma
=
(
SCALE
<
1
)
?
(
SIGMA_SCALE
/
SCALE
)
:
(
SIGMA_SCALE
);
const
double
sigma
=
(
SCALE
<
1
)
?
(
SIGMA_SCALE
/
SCALE
)
:
(
SIGMA_SCALE
);
const
double
sprec
=
3
;
const
double
sprec
=
3
;
const
unsigned
int
h
=
(
unsigned
int
)(
ceil
(
sigma
*
sqrt
(
2
*
sprec
*
log
(
10
))));
const
unsigned
int
h
=
(
unsigned
int
)(
ceil
(
sigma
*
sqrt
(
2
*
sprec
*
log
(
10
.0
))));
Size
ksize
(
1
+
2
*
h
,
1
+
2
*
h
);
// kernel size
Size
ksize
(
1
+
2
*
h
,
1
+
2
*
h
);
// kernel size
GaussianBlur
(
image
,
gaussian_img
,
ksize
,
sigma
);
GaussianBlur
(
image
,
gaussian_img
,
ksize
,
sigma
);
// Scale image to needed size
// Scale image to needed size
...
@@ -234,7 +234,7 @@ void LSD::flsd(std::vector<Vec4i>& lines,
...
@@ -234,7 +234,7 @@ void LSD::flsd(std::vector<Vec4i>& lines,
ll_angle
(
rho
,
N_BINS
,
list
);
ll_angle
(
rho
,
N_BINS
,
list
);
}
}
LOG_NT
=
5
*
(
log10
(
double
(
img_width
))
+
log10
(
double
(
img_height
)))
/
2
+
log10
(
11
);
LOG_NT
=
5
*
(
log10
(
double
(
img_width
))
+
log10
(
double
(
img_height
)))
/
2
+
log10
(
11
.0
);
const
int
min_reg_size
=
int
(
-
LOG_NT
/
log10
(
p
));
// minimal number of points in region that can give a meaningful event
const
int
min_reg_size
=
int
(
-
LOG_NT
/
log10
(
p
));
// minimal number of points in region that can give a meaningful event
// // Initialize region only when needed
// // Initialize region only when needed
...
...
modules/imgproc/test/test_lsd.cpp
View file @
3350533f
...
@@ -109,7 +109,7 @@ TEST_F(LSD_ADV, whiteNoise)
...
@@ -109,7 +109,7 @@ TEST_F(LSD_ADV, whiteNoise)
LSD
detector
(
LSD_REFINE_ADV
);
LSD
detector
(
LSD_REFINE_ADV
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_GE
(
40
,
lines
.
size
());
ASSERT_GE
(
(
unsigned
int
)(
40
)
,
lines
.
size
());
}
}
TEST_F
(
LSD_ADV
,
constColor
)
TEST_F
(
LSD_ADV
,
constColor
)
...
@@ -118,12 +118,12 @@ TEST_F(LSD_ADV, constColor)
...
@@ -118,12 +118,12 @@ TEST_F(LSD_ADV, constColor)
LSD
detector
(
LSD_REFINE_ADV
);
LSD
detector
(
LSD_REFINE_ADV
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_EQ
(
0
,
lines
.
size
());
ASSERT_EQ
(
(
unsigned
int
)(
0
)
,
lines
.
size
());
}
}
TEST_F
(
LSD_ADV
,
lines
)
TEST_F
(
LSD_ADV
,
lines
)
{
{
const
int
numOfLines
=
3
;
const
unsigned
int
numOfLines
=
3
;
GenerateLines
(
test_image
,
numOfLines
);
GenerateLines
(
test_image
,
numOfLines
);
LSD
detector
(
LSD_REFINE_ADV
);
LSD
detector
(
LSD_REFINE_ADV
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
...
@@ -136,7 +136,7 @@ TEST_F(LSD_ADV, rotatedRect)
...
@@ -136,7 +136,7 @@ TEST_F(LSD_ADV, rotatedRect)
GenerateRotatedRect
(
test_image
);
GenerateRotatedRect
(
test_image
);
LSD
detector
(
LSD_REFINE_ADV
);
LSD
detector
(
LSD_REFINE_ADV
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_LE
(
4
,
lines
.
size
());
ASSERT_LE
(
(
unsigned
int
)(
4
)
,
lines
.
size
());
}
}
TEST_F
(
LSD_STD
,
whiteNoise
)
TEST_F
(
LSD_STD
,
whiteNoise
)
...
@@ -145,7 +145,7 @@ TEST_F(LSD_STD, whiteNoise)
...
@@ -145,7 +145,7 @@ TEST_F(LSD_STD, whiteNoise)
LSD
detector
(
LSD_REFINE_STD
);
LSD
detector
(
LSD_REFINE_STD
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_GE
(
50
,
lines
.
size
());
ASSERT_GE
(
(
unsigned
int
)(
50
)
,
lines
.
size
());
}
}
TEST_F
(
LSD_STD
,
constColor
)
TEST_F
(
LSD_STD
,
constColor
)
...
@@ -154,12 +154,12 @@ TEST_F(LSD_STD, constColor)
...
@@ -154,12 +154,12 @@ TEST_F(LSD_STD, constColor)
LSD
detector
(
LSD_REFINE_STD
);
LSD
detector
(
LSD_REFINE_STD
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_EQ
(
0
,
lines
.
size
());
ASSERT_EQ
(
(
unsigned
int
)(
0
)
,
lines
.
size
());
}
}
TEST_F
(
LSD_STD
,
lines
)
TEST_F
(
LSD_STD
,
lines
)
{
{
const
int
numOfLines
=
3
;
//1
const
unsigned
int
numOfLines
=
3
;
//1
GenerateLines
(
test_image
,
numOfLines
);
GenerateLines
(
test_image
,
numOfLines
);
LSD
detector
(
LSD_REFINE_STD
);
LSD
detector
(
LSD_REFINE_STD
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
...
@@ -172,7 +172,7 @@ TEST_F(LSD_STD, rotatedRect)
...
@@ -172,7 +172,7 @@ TEST_F(LSD_STD, rotatedRect)
GenerateRotatedRect
(
test_image
);
GenerateRotatedRect
(
test_image
);
LSD
detector
(
LSD_REFINE_STD
);
LSD
detector
(
LSD_REFINE_STD
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_EQ
(
8
,
lines
.
size
());
ASSERT_EQ
(
(
unsigned
int
)(
8
)
,
lines
.
size
());
}
}
TEST_F
(
LSD_NONE
,
whiteNoise
)
TEST_F
(
LSD_NONE
,
whiteNoise
)
...
@@ -181,7 +181,7 @@ TEST_F(LSD_NONE, whiteNoise)
...
@@ -181,7 +181,7 @@ TEST_F(LSD_NONE, whiteNoise)
LSD
detector
(
LSD_REFINE_NONE
);
LSD
detector
(
LSD_REFINE_NONE
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_GE
(
50
,
lines
.
size
());
ASSERT_GE
(
(
unsigned
int
)(
50
)
,
lines
.
size
());
}
}
TEST_F
(
LSD_NONE
,
constColor
)
TEST_F
(
LSD_NONE
,
constColor
)
...
@@ -190,12 +190,12 @@ TEST_F(LSD_NONE, constColor)
...
@@ -190,12 +190,12 @@ TEST_F(LSD_NONE, constColor)
LSD
detector
(
LSD_REFINE_NONE
);
LSD
detector
(
LSD_REFINE_NONE
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_EQ
(
0
,
lines
.
size
());
ASSERT_EQ
(
(
unsigned
int
)(
0
)
,
lines
.
size
());
}
}
TEST_F
(
LSD_NONE
,
lines
)
TEST_F
(
LSD_NONE
,
lines
)
{
{
const
int
numOfLines
=
3
;
//1
const
unsigned
int
numOfLines
=
3
;
//1
GenerateLines
(
test_image
,
numOfLines
);
GenerateLines
(
test_image
,
numOfLines
);
LSD
detector
(
LSD_REFINE_NONE
);
LSD
detector
(
LSD_REFINE_NONE
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
...
@@ -208,5 +208,5 @@ TEST_F(LSD_NONE, rotatedRect)
...
@@ -208,5 +208,5 @@ TEST_F(LSD_NONE, rotatedRect)
GenerateRotatedRect
(
test_image
);
GenerateRotatedRect
(
test_image
);
LSD
detector
(
LSD_REFINE_NONE
);
LSD
detector
(
LSD_REFINE_NONE
);
detector
.
detect
(
test_image
,
lines
);
detector
.
detect
(
test_image
,
lines
);
ASSERT_EQ
(
8
,
lines
.
size
());
ASSERT_EQ
(
(
unsigned
int
)(
8
)
,
lines
.
size
());
}
}
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