blob: 9db41216590971941bf53298a175ca85f8138e1c [file] [log] [blame]
milind-u92195982022-01-22 20:29:31 -08001#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
7namespace y2022::vision {
8
9class TargetEstimator {
10 public:
11 // Computes the location of the target.
12 // blob_point is the mean (x, y) of blob pixels.
Henry Speisere45e7a22022-02-04 23:17:01 -080013 // 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-u92195982022-01-22 20:29:31 -080018
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_