10 const std::string& camera_id) {
14 return it == cfg.
cameras.end() ? nullptr : &(*it);
19std::unordered_map<std::string, const PlanarImageDetections*> build_point_lookup(
21 std::unordered_map<std::string, const PlanarImageDetections*> lookup;
23 lookup.emplace(image.file, &image);
31 const std::vector<PlanarDetections>&
detections) {
32 std::unordered_map<std::string, SensorDetectionsIndex> index;
34 if (det.sensor_id.empty()) {
40 index.emplace(det.sensor_id, std::move(entry));
49 return {{point.local_x, point.local_y}, {point.x, point.y}};
56 return Eigen::Isometry3d::Identity();
58 Eigen::Vector3d translation = Eigen::Vector3d::Zero();
59 Eigen::Quaterniond q_sum(0.0, 0.0, 0.0, 0.0);
60 for (
const auto& pose : poses) {
61 translation += pose.translation();
62 Eigen::Quaterniond q(pose.linear());
63 if (q_sum.coeffs().dot(q.coeffs()) < 0.0) {
66 q_sum.coeffs() += q.coeffs();
68 translation /=
static_cast<double>(poses.size());
70 Eigen::Isometry3d avg = Eigen::Isometry3d::Identity();
71 avg.linear() = q_sum.toRotationMatrix();
72 avg.translation() = translation;
77 const std::string& rig_id) {
78 const auto it = std::find_if(cfg.
rigs.begin(), cfg.
rigs.end(),
80 return it == cfg.
rigs.end() ? nullptr : &(*it);
std::vector< Eigen::Isometry3d > cam
PlanarDetections detections
const HandEyeRigConfig * find_handeye_rig(const HandEyePipelineConfig &cfg, const std::string &rig_id)
auto make_planar_view(const PlanarImageDetections &detections) -> PlanarView
auto find_camera_config(const IntrinsicCalibrationConfig &cfg, const std::string &camera_id) -> const CameraConfig *
auto build_sensor_index(const std::vector< PlanarDetections > &detections) -> std::unordered_map< std::string, SensorDetectionsIndex >
Eigen::Isometry3d average_isometries(const std::vector< Eigen::Isometry3d > &poses)
std::vector< PlanarObservation > PlanarView
std::vector< HandEyeRigConfig > rigs
Hand-eye rig definition used to configure the calibration stage.
std::vector< CameraConfig > cameras
std::unordered_map< std::string, const PlanarImageDetections * > image_lookup
const PlanarDetections * detections