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 | |
void | Clear () |
Clears the buffer. | |
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. | |
bool | GetMeanPitchAndRoll (double &pitch, double &roll) |
Computes the mean pitch and roll. | |
bool | GetMedianPitchAndRoll (double &pitch, double &roll) |
Computes the median pitch and roll. | |
void | LoadNewData (double new_pitch, double new_roll) |
Loads new pitch and roll data directly onto the buffer. | |
PitchAndRollEstimatorQueue () | |
Constructor. | |
void | SetBufferSize (int32_t buff_size=50) |
Sets the circular buffer capacity for computing statistics. | |
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. | |
~PitchAndRollEstimatorQueue () | |
Private Member Functions | |
void | ComputeStats () |
Computes the statistics on the data in the buffers. | |
Private Attributes | |
double | mean_pitch_ |
double | mean_roll_ |
double | median_pitch_ |
double | median_roll_ |
boost::circular_buffer< double > | pitches_ |
boost::circular_buffer< double > | rolls_ |
A class for estimating image warping based on perspective distortion. Primarily intended for use with downward-facing camera methods.
Definition at line 212 of file image_warp_util.h.
Constructor.
Definition at line 452 of file image_warp_util.cpp.
Definition at line 220 of file image_warp_util.h.
Clears the buffer.
Definition at line 499 of file image_warp_util.cpp.
void swri_image_util::PitchAndRollEstimatorQueue::ComputeStats | ( | ) | [private] |
Computes the statistics on the data in the buffers.
Definition at line 579 of file image_warp_util.cpp.
void swri_image_util::PitchAndRollEstimatorQueue::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.
[in] | points1 | Points from first image |
[in] | points2 | Corresponding points from second image |
[in] | image_size | The size of the image |
Definition at line 512 of file image_warp_util.cpp.
bool swri_image_util::PitchAndRollEstimatorQueue::GetMeanPitchAndRoll | ( | double & | pitch, |
double & | roll | ||
) |
Computes the mean pitch and roll.
[out] | pitch | The computed mean pitch (will be zero if buffer is empty) |
[out] | roll | The computed mean roll (will be zero if buffer is empty) |
Returns | false if the buffer is empty |
Definition at line 537 of file image_warp_util.cpp.
bool swri_image_util::PitchAndRollEstimatorQueue::GetMedianPitchAndRoll | ( | double & | pitch, |
double & | roll | ||
) |
Computes the median pitch and roll.
[out] | pitch | The computed median pitch (will be zero if buffer is empty) |
[out] | roll | The computed median roll (will be zero if buffer is empty) |
Returns | false if the buffer is empty |
Definition at line 551 of file image_warp_util.cpp.
void swri_image_util::PitchAndRollEstimatorQueue::LoadNewData | ( | double | new_pitch, |
double | new_roll | ||
) |
Loads new pitch and roll data directly onto the buffer.
[in] | new_pitch | New pitch data |
[in] | new_roll | New roll data |
Definition at line 566 of file image_warp_util.cpp.
void swri_image_util::PitchAndRollEstimatorQueue::SetBufferSize | ( | int32_t | buff_size = 50 | ) |
Sets the circular buffer capacity for computing statistics.
[in] | buff_size | The desired size of the buffer |
Definition at line 463 of file image_warp_util.cpp.
void swri_image_util::PitchAndRollEstimatorQueue::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.
[in] | points_in | The input points matrix |
[out] | points_out | The output points matrix |
[in] | image_size | The corresponding image size |
[in] | use_median | Specify whether to use median or mean values, default is use_median = true |
Definition at line 475 of file image_warp_util.cpp.
double swri_image_util::PitchAndRollEstimatorQueue::mean_pitch_ [private] |
Definition at line 300 of file image_warp_util.h.
double swri_image_util::PitchAndRollEstimatorQueue::mean_roll_ [private] |
Definition at line 301 of file image_warp_util.h.
double swri_image_util::PitchAndRollEstimatorQueue::median_pitch_ [private] |
Definition at line 302 of file image_warp_util.h.
double swri_image_util::PitchAndRollEstimatorQueue::median_roll_ [private] |
Definition at line 303 of file image_warp_util.h.
boost::circular_buffer<double> swri_image_util::PitchAndRollEstimatorQueue::pitches_ [private] |
Definition at line 297 of file image_warp_util.h.
boost::circular_buffer<double> swri_image_util::PitchAndRollEstimatorQueue::rolls_ [private] |
Definition at line 298 of file image_warp_util.h.