Parker Schuh | 0ff777c | 2017-02-19 15:01:13 -0800 | [diff] [blame] | 1 | #ifndef AOS_VISION_BLOB_MOVE_SCALE_H_ |
| 2 | #define AOS_VISION_BLOB_MOVE_SCALE_H_ |
| 3 | |
Parker Schuh | 0ff777c | 2017-02-19 15:01:13 -0800 | [diff] [blame] | 4 | #include <limits> |
Parker Schuh | 309dd72 | 2017-02-25 11:31:18 -0800 | [diff] [blame^] | 5 | #include <vector> |
Parker Schuh | 0ff777c | 2017-02-19 15:01:13 -0800 | [diff] [blame] | 6 | |
| 7 | #include "aos/vision/blob/range_image.h" |
| 8 | |
| 9 | namespace aos { |
| 10 | namespace vision { |
| 11 | |
| 12 | // Bounding box for a RangeImage. |
| 13 | struct 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. |
| 22 | void GetBBox(const RangeImage &img, ImageBBox *bbox); |
| 23 | inline void GetBBox(const std::vector<RangeImage> &imgs, ImageBBox *bbox) { |
| 24 | for (const auto &img : imgs) GetBBox(img, bbox); |
| 25 | } |
| 26 | |
| 27 | std::vector<RangeImage> MoveScale(const std::vector<RangeImage> &imgs, int dx, |
| 28 | int dy, int scale); |
| 29 | |
| 30 | RangeImage 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_ |