Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
746af7f8
Commit
746af7f8
authored
Jun 23, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the hough_transform's functions for getting line coordinates use dpoint
instead of point.
parent
cd8411a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
hough_transform.h
dlib/image_transforms/hough_transform.h
+7
-7
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
<
dpoint
,
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<
dpoint,dpoint> 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
<
dpoint
,
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