Commit 5a2e0d6a authored by Davis King's avatar Davis King

Added centered_rects()

parent b3178059
......@@ -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 (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment