blob: c113bca4b1000e4e3ba97430ba97068102bb4bd0 [file] [log] [blame]
Parker Schuh0ff777c2017-02-19 15:01:13 -08001#ifndef AOS_VISION_BLOB_MOVE_SCALE_H_
2#define AOS_VISION_BLOB_MOVE_SCALE_H_
3
4#include <vector>
5#include <limits>
6
7#include "aos/vision/blob/range_image.h"
8
9namespace aos {
10namespace vision {
11
12// Bounding box for a RangeImage.
13struct ImageBBox {
14 int minx = std::numeric_limits<int>::max();
15 int maxx = std::numeric_limits<int>::min();
16 int miny = std::numeric_limits<int>::max();
17 int maxy = std::numeric_limits<int>::min();
18};
19
20// Sums img into bbox. bbox is constructed empty and grows with each call
21// to GetBBox.
22void GetBBox(const RangeImage &img, ImageBBox *bbox);
23inline void GetBBox(const std::vector<RangeImage> &imgs, ImageBBox *bbox) {
24 for (const auto &img : imgs) GetBBox(img, bbox);
25}
26
27std::vector<RangeImage> MoveScale(const std::vector<RangeImage> &imgs, int dx,
28 int dy, int scale);
29
30RangeImage MoveScale(const RangeImage &img, int dx, int dy, int scale);
31
32} // namespace vision
33} // namespace aos
34
35#endif // AOS_VISION_BLOB_MOVE_SCALE_H_