blob: 4988c3c9a5f966309af51f600000a49b89b96f50 [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.
13 static TargetEstimateT EstimateTargetLocation(cv::Point2i blob_point,
14 const cv::Mat &intrinsics,
15 const cv::Mat &extrinsics);
16
17 private:
18 // Height of the center of the tape (m)
19 static constexpr double kTapeHeight = 2.58 + (0.05 / 2);
20 // Horizontal distance from tape to center of hub (m)
21 static constexpr double kUpperHubRadius = 1.22 / 2;
22};
23
24} // namespace y2022::vision
25
26#endif // Y2022_VISION_POSE_ESTIMATOR_H_