Go to the documentation of this file.
   30 #ifndef IMAGE_UTIL_IMAGE_WARP_UTIL_H_ 
   31 #define IMAGE_UTIL_IMAGE_WARP_UTIL_H_ 
   36 #include <boost/circular_buffer.hpp> 
   42 #include <opencv2/core/core.hpp> 
   43 #include <opencv2/highgui/highgui.hpp> 
   44 #include <opencv2/features2d/features2d.hpp> 
   45 #include <opencv2/calib3d/calib3d.hpp> 
   46 #include <opencv2/stitching/detail/warpers.hpp> 
   53   cv::Mat 
WarpImage(
const cv::Mat& image, 
double roll, 
double pitch);
 
   67       const cv::Size& image_size,
 
   68       const cv::Mat& pts_in,
 
   83       const cv::Size& image_size,
 
   84       const std::vector<cv::KeyPoint>& pts_in,
 
   85       std::vector<cv::KeyPoint>& pts_out);
 
   97   cv::Mat 
GetR(
double pitch, 
double roll, 
double yaw = 0.0);
 
  121                                  double& nominal_roll,
 
  122                                  bool show_image_diff = 
false);
 
  132                                         const cv::Mat& points2,
 
  133                                         const cv::Size& image_size,
 
  134                                         double& nominal_pitch,
 
  135                                         double& nominal_roll);
 
  144     std::vector<cv::KeyPoint> 
kp1_;
 
  145     std::vector<cv::KeyPoint> 
kp2_;
 
  192                     const cv::Mat& pts_in,
 
  203                           const cv::Mat& pts_in,
 
  245                     const cv::Size& image_size,
 
  246                     bool use_median = 
true);
 
  257                              const cv::Mat& points2,
 
  258                              const cv::Size& image_size);
 
  312 #endif  // IMAGE_UTIL_IMAGE_WARP_UTIL_H_ 
  
void GenerateNewEstimate(const cv::Mat &points1, const cv::Mat &points2, const cv::Size &image_size)
Estimates pitch and roll from corresponding points and loads the pitch and roll data onto the buffer.
 
cv::Mat WarpImage(const cv::Mat &image, double roll, double pitch)
 
void ComputeStats()
Computes the statistics on the data in the buffers.
 
boost::circular_buffer< double > pitches_
 
std::vector< cv::KeyPoint > kp2_
 
cv::Mat GetR(double pitch, double roll, double yaw=0.0)
Gets the rotation matrix associated with the specified pitch and roll values.
 
A class for estimating image warping based on perspective distortion. Primarily intended for use with...
 
bool GetMeanPitchAndRoll(double &pitch, double &roll)
Computes the mean pitch and roll.
 
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 poi...
 
void Clear()
Clears the buffer.
 
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)
 
bool ComputeGeometricMatches()
Matches keypoints using loose geometric constraints and stores them in kp1_matched_ and kp2_matched_.
 
PitchAndRollEstimator()
Constructor.
 
boost::circular_buffer< double > rolls_
 
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)
 
std::vector< cv::KeyPoint > kp1_
 
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 ima...
 
~PitchAndRollEstimatorQueue()
 
A class for estimating image warping based on perspective distortion. Primarily intended for use with...
 
cv::detail::PlaneWarper warper_
 
void WarpPoints(double pitch, double roll, const cv::Size &image_size, const cv::Mat &pts_in, cv::Mat &pts_out)
 
void WarpPoints(const cv::Mat &points_in, cv::Mat &points_out, const cv::Size &image_size, bool use_median=true)
Warps points based on the stored estimated pitch and roll.
 
bool GetMedianPitchAndRoll(double &pitch, double &roll)
Computes the median pitch and roll.
 
void SetBufferSize(int32_t buff_size=50)
Sets the circular buffer capacity for computing statistics.
 
void LoadNewData(double new_pitch, double new_roll)
Loads new pitch and roll data directly onto the buffer.
 
PitchAndRollEstimatorQueue()
Constructor.
 
swri_image_util
Author(s): Kris Kozak
autogenerated on Thu Feb 27 2025 03:34:08