A class for estimating image warping based on perspective distortion. Primarily intended for use with downward-facing camera methods. More...
#include <image_warp_util.h>
Public Member Functions | |
cv::Mat | EstimateNominalAngle (double &nominal_pitch, double &nominal_roll, bool show_image_diff=false) |
Estimates the nominal pitch and roll of the camera (from perfectly vertical) from two overlapping images. | |
PitchAndRollEstimator () | |
Constructor. | |
Static Public Member Functions | |
static cv::Mat | EstimateNominalAngle (const cv::Mat &points1, const cv::Mat &points2, const cv::Size &image_size, double &nominal_pitch, double &nominal_roll) |
Estimates the nominal pitch and roll of the camera (from perfectly vertical) from two overlapping images. | |
Private Member Functions | |
bool | ComputeGeometricMatches () |
Matches keypoints using loose geometric constraints and stores them in kp1_matched_ and kp2_matched_. | |
void | WarpAffinePoints (const cv::Mat &T, const cv::Mat &pts_in, cv::Mat &pts_out) |
Warps a matrix of points (in the same form as the inliers) | |
void | WarpPoints (double pitch, double roll, const cv::Mat &pts_in, cv::Mat &pts_out) |
Warps a matrix of points (in the same form as the inliers) | |
Static Private Member Functions | |
static bool | EstimateTransforms (cv::Mat &pts1, cv::Mat &pts2, cv::Mat &T_affine, cv::Mat &T_rigid, double &rms_error) |
Estimates the "nearest" rigid, and corresponding full affine transformation for a set of matching points. | |
Private Attributes | |
cv::Mat | descriptors1_ |
cv::Mat | descriptors2_ |
cv::Mat | im1_ |
cv::Mat | im2_ |
cv::Mat | K_ |
std::vector< cv::KeyPoint > | kp1_ |
cv::Mat | kp1_matched_ |
std::vector< cv::KeyPoint > | kp2_ |
cv::Mat | kp2_matched_ |
cv::Mat | T_ |
cv::detail::PlaneWarper | warper_ |
A class for estimating image warping based on perspective distortion. Primarily intended for use with downward-facing camera methods.
Definition at line 105 of file image_warp_util.h.
Constructor.
Definition at line 111 of file image_warp_util.h.
bool swri_image_util::PitchAndRollEstimator::ComputeGeometricMatches | ( | ) | [private] |
Matches keypoints using loose geometric constraints and stores them in kp1_matched_ and kp2_matched_.
Returns | false if unable to find valid matches |
Definition at line 299 of file image_warp_util.cpp.
cv::Mat swri_image_util::PitchAndRollEstimator::EstimateNominalAngle | ( | double & | nominal_pitch, |
double & | nominal_roll, | ||
bool | show_image_diff = false |
||
) |
Estimates the nominal pitch and roll of the camera (from perfectly vertical) from two overlapping images.
Definition at line 145 of file image_warp_util.cpp.
cv::Mat swri_image_util::PitchAndRollEstimator::EstimateNominalAngle | ( | const cv::Mat & | points1, |
const cv::Mat & | points2, | ||
const cv::Size & | image_size, | ||
double & | nominal_pitch, | ||
double & | nominal_roll | ||
) | [static] |
Estimates the nominal pitch and roll of the camera (from perfectly vertical) from two overlapping images.
Definition at line 206 of file image_warp_util.cpp.
bool swri_image_util::PitchAndRollEstimator::EstimateTransforms | ( | cv::Mat & | pts1, |
cv::Mat & | pts2, | ||
cv::Mat & | T_affine, | ||
cv::Mat & | T_rigid, | ||
double & | rms_error | ||
) | [static, private] |
Estimates the "nearest" rigid, and corresponding full affine transformation for a set of matching points.
[in] | pts1 | |
[in] | pts2 | |
[out] | T_affine | |
[out] | T_rigid | |
[out] | rms_error | The RMS (distance) error for inlier points using the rigid transform |
Returns | false if unable to find enough valid matches |
Definition at line 360 of file image_warp_util.cpp.
void swri_image_util::PitchAndRollEstimator::WarpAffinePoints | ( | const cv::Mat & | T, |
const cv::Mat & | pts_in, | ||
cv::Mat & | pts_out | ||
) | [private] |
Warps a matrix of points (in the same form as the inliers)
[in] | T | The 2D rigid transform to use for warping |
[in] | pts_in | The points to warp |
[out] | pts_out | The warped points |
Definition at line 411 of file image_warp_util.cpp.
void swri_image_util::PitchAndRollEstimator::WarpPoints | ( | double | pitch, |
double | roll, | ||
const cv::Mat & | pts_in, | ||
cv::Mat & | pts_out | ||
) | [private] |
Warps a matrix of points (in the same form as the inliers)
[in] | pitch | The pitch used to warp the point |
[in] | roll | The roll used to warp the point |
[in] | pts_in | The points to warp |
[out] | pts_out | The warped points |
Definition at line 391 of file image_warp_util.cpp.
cv::Mat swri_image_util::PitchAndRollEstimator::descriptors1_ [private] |
Definition at line 146 of file image_warp_util.h.
cv::Mat swri_image_util::PitchAndRollEstimator::descriptors2_ [private] |
Definition at line 147 of file image_warp_util.h.
cv::Mat swri_image_util::PitchAndRollEstimator::im1_ [private] |
Definition at line 138 of file image_warp_util.h.
cv::Mat swri_image_util::PitchAndRollEstimator::im2_ [private] |
Definition at line 139 of file image_warp_util.h.
cv::Mat swri_image_util::PitchAndRollEstimator::K_ [private] |
Definition at line 141 of file image_warp_util.h.
std::vector<cv::KeyPoint> swri_image_util::PitchAndRollEstimator::kp1_ [private] |
Definition at line 144 of file image_warp_util.h.
cv::Mat swri_image_util::PitchAndRollEstimator::kp1_matched_ [private] |
Definition at line 149 of file image_warp_util.h.
std::vector<cv::KeyPoint> swri_image_util::PitchAndRollEstimator::kp2_ [private] |
Definition at line 145 of file image_warp_util.h.
cv::Mat swri_image_util::PitchAndRollEstimator::kp2_matched_ [private] |
Definition at line 150 of file image_warp_util.h.
cv::Mat swri_image_util::PitchAndRollEstimator::T_ [private] |
Definition at line 142 of file image_warp_util.h.
cv::detail::PlaneWarper swri_image_util::PitchAndRollEstimator::warper_ [private] |
Definition at line 152 of file image_warp_util.h.