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
0c652dd4
Commit
0c652dd4
authored
Jun 22, 2018
by
Davis King
Browse files
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
dlib/geometry/line.h
dlib/geometry/line.h
+3
-2
dlib/geometry/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