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
0c652dd4
Commit
0c652dd4
authored
Jun 23, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made count_points_on_side_of_line() take a lower threshold in addition to the
upper threshold. This changes the function's API.
parent
5f9c881f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
line.h
dlib/geometry/line.h
+3
-2
line_abstract.h
dlib/geometry/line_abstract.h
+9
-3
No files found.
dlib/geometry/line.h
View file @
0c652dd4
...
...
@@ -134,7 +134,8 @@ namespace dlib
line
l
,
const
dpoint
&
reference_point
,
const
std
::
vector
<
vector
<
T
,
2
>>&
pts
,
const
double
&
dist_thresh
const
double
&
dist_thresh_min
=
0
,
const
double
&
dist_thresh_max
=
std
::
numeric_limits
<
double
>::
infinity
()
)
{
if
(
signed_distance_to_line
(
l
,
reference_point
)
<
0
)
...
...
@@ -144,7 +145,7 @@ namespace dlib
for
(
auto
&
p
:
pts
)
{
double
dist
=
signed_distance_to_line
(
l
,
p
);
if
(
0
<=
dist
&&
dist
<=
dist_thresh
)
if
(
dist_thresh_min
<=
dist
&&
dist
<=
dist_thresh_max
)
++
cnt
;
}
return
cnt
;
...
...
dlib/geometry/line_abstract.h
View file @
0c652dd4
...
...
@@ -176,12 +176,18 @@ namespace dlib
const
line
&
l
,
const
dpoint
&
reference_point
,
const
std
::
vector
<
vector
<
T
,
2
>>&
pts
,
const
double
&
dist_thresh
const
double
&
dist_thresh_min
=
0
,
const
double
&
dist_thresh_max
=
std
::
numeric_limits
<
double
>::
infinity
()
);
/*!
ensures
- Returns a count of how many points in pts are on the same side of l as
reference_point, but also no more than dist_thresh distance from the line.
- Returns a count of how many points in pts have a distance from the line l
that is in the range [dist_thresh_min, dist_thresh_max]. This distance is a
signed value that indicates how far a point is from the line. Moreover, if
the point is on the same side as reference_point then the distance is
positive, otherwise it is negative. So for example, If this range is [0,
infinity] then this function counts how many points are on the same side of l
as reference_point.
!*/
// ----------------------------------------------------------------------------------------
...
...
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