blob: e45e14da992d7d2a7df5330e3668626a4f4d6408 [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
Parker Schuh0ff777c2017-02-19 15:01:13 -08004#include <limits>
Parker Schuh309dd722017-02-25 11:31:18 -08005#include <vector>
Parker Schuh0ff777c2017-02-19 15:01:13 -08006
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_