#include <cv_bridge/cv_bridge.h>
#include <dynamic_reconfigure/server.h>
#include <image_geometry/pinhole_camera_model.h>
#include <message_filters/subscriber.h>
#include <message_filters/time_synchronizer.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>
#include <ros/ros.h>
#include <sensor_msgs/CameraInfo.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/PointCloud2.h>
#include <std_msgs/Empty.h>
#include <velo2cam_calibration/ClusterCentroids.h>
#include <velo2cam_calibration/MonocularConfig.h>
#include <velo2cam_utils.h>
#include <opencv2/aruco.hpp>
#include <opencv2/opencv.hpp>
Go to the source code of this file.
Functions | |
Eigen::Matrix3f | covariance (pcl::PointCloud< pcl::PointXYZ >::Ptr cumulative_cloud, Eigen::Vector3f means) |
void | imageCallback (const sensor_msgs::ImageConstPtr &msg, const sensor_msgs::CameraInfoConstPtr &left_info) |
int | main (int argc, char **argv) |
Eigen::Vector3f | mean (pcl::PointCloud< pcl::PointXYZ >::Ptr cumulative_cloud) |
void | param_callback (velo2cam_calibration::MonocularConfig &config, uint32_t level) |
Point2f | projectPointDist (cv::Point3f pt_cv, const Mat intrinsics, const Mat distCoeffs) |
void | warmup_callback (const std_msgs::Empty::ConstPtr &msg) |
Variables | |
ros::Publisher | centers_cloud_pub |
double | cluster_tolerance_ |
ros::Publisher | clusters_pub |
pcl::PointCloud< pcl::PointXYZ >::Ptr | cumulative_cloud |
ros::Publisher | cumulative_pub |
double | delta_height_circles_ |
double | delta_height_qr_center_ |
double | delta_width_circles_ |
double | delta_width_qr_center_ |
cv::Ptr< cv::aruco::Dictionary > | dictionary |
int | frames_proc_ = 0 |
int | frames_used_ = 0 |
double | marker_size_ |
double | min_cluster_factor_ |
int | min_detected_markers_ |
ros::Publisher | qr_pub |
bool | save_to_file_ |
std::ofstream | savefile |
bool | skip_warmup_ |
bool | WARMUP_DONE = false |
Eigen::Matrix3f covariance | ( | pcl::PointCloud< pcl::PointXYZ >::Ptr | cumulative_cloud, |
Eigen::Vector3f | means | ||
) |
Definition at line 93 of file mono_qr_pattern.cpp.
void imageCallback | ( | const sensor_msgs::ImageConstPtr & | msg, |
const sensor_msgs::CameraInfoConstPtr & | left_info | ||
) |
NOTE: This is included here in the same way as the rest of the modalities to avoid obvious misdetections, which sometimes happened in our experiments. In this modality, it should be impossible to have more than a set of candidates, but we keep the ability of handling different combinations for eventual future extensions.
Geometric consistency check At this point, circles' center candidates have been computed (found_centers). Now we need to select the set of 4 candidates that best fit the calibration target geometry. To that end, the following steps are followed: 1) Create a cloud with 4 points representing the exact geometry of the calibration target 2) For each possible set of 4 points: compute similarity score 3) Rotate back the candidates with the highest score to their original position in the cloud, and add them to cumulative cloud
Definition at line 119 of file mono_qr_pattern.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 516 of file mono_qr_pattern.cpp.
Eigen::Vector3f mean | ( | pcl::PointCloud< pcl::PointXYZ >::Ptr | cumulative_cloud | ) |
Definition at line 80 of file mono_qr_pattern.cpp.
void param_callback | ( | velo2cam_calibration::MonocularConfig & | config, |
uint32_t | level | ||
) |
Definition at line 497 of file mono_qr_pattern.cpp.
Point2f projectPointDist | ( | cv::Point3f | pt_cv, |
const Mat | intrinsics, | ||
const Mat | distCoeffs | ||
) |
Definition at line 68 of file mono_qr_pattern.cpp.
void warmup_callback | ( | const std_msgs::Empty::ConstPtr & | msg | ) |
Definition at line 507 of file mono_qr_pattern.cpp.
ros::Publisher centers_cloud_pub |
Definition at line 52 of file mono_qr_pattern.cpp.
double cluster_tolerance_ |
Definition at line 59 of file mono_qr_pattern.cpp.
ros::Publisher clusters_pub |
Definition at line 52 of file mono_qr_pattern.cpp.
pcl::PointCloud<pcl::PointXYZ>::Ptr cumulative_cloud |
Definition at line 50 of file mono_qr_pattern.cpp.
ros::Publisher cumulative_pub |
Definition at line 52 of file mono_qr_pattern.cpp.
double delta_height_circles_ |
Definition at line 56 of file mono_qr_pattern.cpp.
double delta_height_qr_center_ |
Definition at line 55 of file mono_qr_pattern.cpp.
double delta_width_circles_ |
Definition at line 56 of file mono_qr_pattern.cpp.
double delta_width_qr_center_ |
Definition at line 55 of file mono_qr_pattern.cpp.
cv::Ptr<cv::aruco::Dictionary> dictionary |
Definition at line 51 of file mono_qr_pattern.cpp.
int frames_proc_ = 0 |
Definition at line 58 of file mono_qr_pattern.cpp.
int frames_used_ = 0 |
Definition at line 58 of file mono_qr_pattern.cpp.
double marker_size_ |
Definition at line 55 of file mono_qr_pattern.cpp.
double min_cluster_factor_ |
Definition at line 60 of file mono_qr_pattern.cpp.
int min_detected_markers_ |
Definition at line 57 of file mono_qr_pattern.cpp.
ros::Publisher qr_pub |
Definition at line 52 of file mono_qr_pattern.cpp.
bool save_to_file_ |
Definition at line 65 of file mono_qr_pattern.cpp.
std::ofstream savefile |
Definition at line 66 of file mono_qr_pattern.cpp.
bool skip_warmup_ |
Definition at line 64 of file mono_qr_pattern.cpp.
bool WARMUP_DONE = false |
Definition at line 62 of file mono_qr_pattern.cpp.