Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
swri_image_util::PitchAndRollEstimator Class Reference

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. More...
 
 PitchAndRollEstimator ()
 Constructor. More...
 

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. More...
 

Private Member Functions

bool ComputeGeometricMatches ()
 Matches keypoints using loose geometric constraints and stores them in kp1_matched_ and kp2_matched_. More...
 
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) More...
 
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) More...
 

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. More...
 

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_
 

Detailed Description

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 & Destructor Documentation

swri_image_util::PitchAndRollEstimator::PitchAndRollEstimator ( )
inline

Constructor.

Definition at line 111 of file image_warp_util.h.

Member Function Documentation

bool swri_image_util::PitchAndRollEstimator::ComputeGeometricMatches ( )
private

Matches keypoints using loose geometric constraints and stores them in kp1_matched_ and kp2_matched_.

Return values
Returnsfalse 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.

Returns
Returns the rotation matrix for the computed pitch and roll

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.

Returns
Returns the rotation matrix for the computed pitch and roll

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 
)
staticprivate

Estimates the "nearest" rigid, and corresponding full affine transformation for a set of matching points.

Parameters
[in]pts1
[in]pts2
[out]T_affine
[out]T_rigid
[out]rms_errorThe RMS (distance) error for inlier points using the rigid transform
Return values
Returnsfalse 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)

Parameters
[in]TThe 2D rigid transform to use for warping
[in]pts_inThe points to warp
[out]pts_outThe 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)

Parameters
[in]pitchThe pitch used to warp the point
[in]rollThe roll used to warp the point
[in]pts_inThe points to warp
[out]pts_outThe warped points

Definition at line 391 of file image_warp_util.cpp.

Member Data Documentation

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.


The documentation for this class was generated from the following files:


swri_image_util
Author(s): Kris Kozak
autogenerated on Tue Apr 6 2021 02:50:39