mirror of https://github.com/davisking/dlib.git
Added centered_rects()
This commit is contained in:
parent
b31780590c
commit
5a2e0d6a4d
|
@ -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 (
|
||||
|
|
|
@ -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 (
|
||||
|
|
Loading…
Reference in New Issue