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
5a2e0d6a
Commit
5a2e0d6a
authored
May 16, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added centered_rects()
parent
b3178059
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
rectangle.h
dlib/geometry/rectangle.h
+15
-0
rectangle_abstract.h
dlib/geometry/rectangle_abstract.h
+14
-0
No files found.
dlib/geometry/rectangle.h
View file @
5a2e0d6a
...
...
@@ -571,6 +571,21 @@ namespace dlib
return
centered_rect
(
p
.
x
(),
p
.
y
(),
width
,
height
);
}
// ----------------------------------------------------------------------------------------
inline
std
::
vector
<
rectangle
>
centered_rects
(
const
std
::
vector
<
point
>&
pts
,
unsigned
long
width
,
unsigned
long
height
)
{
std
::
vector
<
rectangle
>
tmp
;
tmp
.
reserve
(
pts
.
size
());
for
(
auto
&
p
:
pts
)
tmp
.
emplace_back
(
centered_rect
(
p
,
width
,
height
));
return
tmp
;
}
// ----------------------------------------------------------------------------------------
inline
const
rectangle
centered_rect
(
...
...
dlib/geometry/rectangle_abstract.h
View file @
5a2e0d6a
...
...
@@ -452,6 +452,20 @@ namespace dlib
- R.tl_corner() == point(p.x()-width/2, p.y()-height/2)
!*/
// ----------------------------------------------------------------------------------------
inline
std
::
vector
<
rectangle
>
centered_rects
(
const
std
::
vector
<
point
>&
pts
,
unsigned
long
width
,
unsigned
long
height
);
/*!
ensures
- returns an array ARR where:
- #ARR.size() == pts.size()
- #ARR[i] == centered_rect(pts[i], width, height)
!*/
// ----------------------------------------------------------------------------------------
const
rectangle
centered_rect
(
...
...
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