Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
746af7f8
Commit
746af7f8
authored
Jun 23, 2018
by
Davis King
Browse files
Made the hough_transform's functions for getting line coordinates use dpoint
instead of point.
parent
cd8411a8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
dlib/image_transforms/hough_transform.h
dlib/image_transforms/hough_transform.h
+7
-7
dlib/image_transforms/hough_transform_abstract.h
dlib/image_transforms/hough_transform_abstract.h
+8
-4
No files found.
dlib/image_transforms/hough_transform.h
View file @
746af7f8
...
...
@@ -68,12 +68,12 @@ namespace dlib
long
nc
(
)
const
{
return
_size
;
}
std
::
pair
<
point
,
point
>
get_line
(
const
point
&
p
std
::
pair
<
d
point
,
d
point
>
get_line
(
const
d
point
&
p
)
const
{
DLIB_ASSERT
(
rectangle
(
0
,
0
,
size
()
-
1
,
size
()
-
1
).
contains
(
p
)
==
true
,
"
\t
pair<point,point> hough_transform::get_line(point)"
"
\t
pair<
d
point,
d
point> hough_transform::get_line(
d
point)"
<<
"
\n\t
Invalid arguments given to this function."
<<
"
\n\t
p: "
<<
p
<<
"
\n\t
size(): "
<<
size
()
...
...
@@ -90,8 +90,8 @@ namespace dlib
const
dpoint
cent
=
center
(
box
);
dpoint
v1
=
cent
+
dpoint
(
size
()
+
1000
,
0
)
+
dpoint
(
0
,
radius
);
dpoint
v2
=
cent
-
dpoint
(
size
()
+
1000
,
0
)
+
dpoint
(
0
,
radius
);
point
p1
=
rotate_point
(
cent
,
v1
,
theta
);
point
p2
=
rotate_point
(
cent
,
v2
,
theta
);
d
point
p1
=
rotate_point
(
cent
,
v1
,
theta
);
d
point
p2
=
rotate_point
(
cent
,
v2
,
theta
);
clip_line_to_rectangle
(
box
,
p1
,
p2
);
...
...
@@ -99,7 +99,7 @@ namespace dlib
}
double
get_line_angle_in_degrees
(
const
point
&
p
const
d
point
&
p
)
const
{
double
angle
,
radius
;
...
...
@@ -108,7 +108,7 @@ namespace dlib
}
void
get_line_properties
(
const
point
&
p
,
const
d
point
&
p
,
double
&
angle_in_degrees
,
double
&
radius
)
const
...
...
dlib/image_transforms/hough_transform_abstract.h
View file @
746af7f8
...
...
@@ -65,8 +65,8 @@ namespace dlib
- returns size()
!*/
std
::
pair
<
point
,
point
>
get_line
(
const
point
&
p
std
::
pair
<
d
point
,
d
point
>
get_line
(
const
d
point
&
p
)
const
;
/*!
requires
...
...
@@ -79,7 +79,7 @@ namespace dlib
!*/
double
get_line_angle_in_degrees
(
const
point
&
p
const
d
point
&
p
)
const
;
/*!
requires
...
...
@@ -91,7 +91,7 @@ namespace dlib
!*/
void
get_line_properties
(
const
point
&
p
,
const
d
point
&
p
,
double
&
angle_in_degrees
,
double
&
radius
)
const
;
...
...
@@ -107,6 +107,10 @@ namespace dlib
- #radius == the distance from the center of the input image, measured in
pixels, and the line corresponding to the Hough transform point p.
Moreover: -sqrt(size()*size()/2) <= #radius <= sqrt(size()*size()/2)
- Note that the line properties are calculated to sub-pixel accuracy. That
is, p doesn't have to contain integer values, it can reference locations
between pixels and the appropriate calculation will be done to find the
corresponding line.
!*/
template
<
...
...
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