milind-u | 9219598 | 2022-01-22 20:29:31 -0800 | [diff] [blame] | 1 | #ifndef Y2022_VISION_POSE_ESTIMATOR_H_ |
| 2 | #define Y2022_VISION_POSE_ESTIMATOR_H_ |
| 3 | |
| 4 | #include "opencv2/imgproc.hpp" |
| 5 | #include "y2022/vision/target_estimate_generated.h" |
| 6 | |
| 7 | namespace y2022::vision { |
| 8 | |
| 9 | class TargetEstimator { |
| 10 | public: |
| 11 | // Computes the location of the target. |
| 12 | // blob_point is the mean (x, y) of blob pixels. |
Henry Speiser | e45e7a2 | 2022-02-04 23:17:01 -0800 | [diff] [blame] | 13 | // Adds angle_to_target and distance to the given builder. |
| 14 | static void EstimateTargetLocation(cv::Point2i centroid, |
| 15 | const cv::Mat &intrinsics, |
| 16 | const cv::Mat &extrinsics, |
| 17 | TargetEstimate::Builder *builder); |
milind-u | 9219598 | 2022-01-22 20:29:31 -0800 | [diff] [blame] | 18 | |
| 19 | private: |
| 20 | // Height of the center of the tape (m) |
| 21 | static constexpr double kTapeHeight = 2.58 + (0.05 / 2); |
| 22 | // Horizontal distance from tape to center of hub (m) |
| 23 | static constexpr double kUpperHubRadius = 1.22 / 2; |
| 24 | }; |
| 25 | |
| 26 | } // namespace y2022::vision |
| 27 | |
| 28 | #endif // Y2022_VISION_POSE_ESTIMATOR_H_ |