Public Member Functions | Private Member Functions | Private Attributes | List of all members
swri_image_util::PitchAndRollEstimatorQueue 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

void Clear ()
 Clears the buffer. More...
 
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. More...
 
bool GetMeanPitchAndRoll (double &pitch, double &roll)
 Computes the mean pitch and roll. More...
 
bool GetMedianPitchAndRoll (double &pitch, double &roll)
 Computes the median pitch and roll. More...
 
void LoadNewData (double new_pitch, double new_roll)
 Loads new pitch and roll data directly onto the buffer. More...
 
 PitchAndRollEstimatorQueue ()
 Constructor. More...
 
void SetBufferSize (int32_t buff_size=50)
 Sets the circular buffer capacity for computing statistics. More...
 
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. More...
 
 ~PitchAndRollEstimatorQueue ()
 

Private Member Functions

void ComputeStats ()
 Computes the statistics on the data in the buffers. More...
 

Private Attributes

double mean_pitch_
 
double mean_roll_
 
double median_pitch_
 
double median_roll_
 
boost::circular_buffer< double > pitches_
 
boost::circular_buffer< double > rolls_
 

Detailed Description

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

◆ PitchAndRollEstimatorQueue()

swri_image_util::PitchAndRollEstimatorQueue::PitchAndRollEstimatorQueue ( )

Constructor.

Definition at line 452 of file image_warp_util.cpp.

◆ ~PitchAndRollEstimatorQueue()

swri_image_util::PitchAndRollEstimatorQueue::~PitchAndRollEstimatorQueue ( )
inline

Definition at line 220 of file image_warp_util.h.

Member Function Documentation

◆ Clear()

void swri_image_util::PitchAndRollEstimatorQueue::Clear ( )

Clears the buffer.

Definition at line 499 of file image_warp_util.cpp.

◆ ComputeStats()

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.

◆ GenerateNewEstimate()

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.

Parameters
[in]points1Points from first image
[in]points2Corresponding points from second image
[in]image_sizeThe size of the image

Definition at line 512 of file image_warp_util.cpp.

◆ GetMeanPitchAndRoll()

bool swri_image_util::PitchAndRollEstimatorQueue::GetMeanPitchAndRoll ( double &  pitch,
double &  roll 
)

Computes the mean pitch and roll.

Parameters
[out]pitchThe computed mean pitch (will be zero if buffer is empty)
[out]rollThe computed mean roll (will be zero if buffer is empty)
Return values
Returnsfalse if the buffer is empty

Definition at line 537 of file image_warp_util.cpp.

◆ GetMedianPitchAndRoll()

bool swri_image_util::PitchAndRollEstimatorQueue::GetMedianPitchAndRoll ( double &  pitch,
double &  roll 
)

Computes the median pitch and roll.

Parameters
[out]pitchThe computed median pitch (will be zero if buffer is empty)
[out]rollThe computed median roll (will be zero if buffer is empty)
Return values
Returnsfalse if the buffer is empty

Definition at line 551 of file image_warp_util.cpp.

◆ LoadNewData()

void swri_image_util::PitchAndRollEstimatorQueue::LoadNewData ( double  new_pitch,
double  new_roll 
)

Loads new pitch and roll data directly onto the buffer.

Parameters
[in]new_pitchNew pitch data
[in]new_rollNew roll data

Definition at line 566 of file image_warp_util.cpp.

◆ SetBufferSize()

void swri_image_util::PitchAndRollEstimatorQueue::SetBufferSize ( int32_t  buff_size = 50)

Sets the circular buffer capacity for computing statistics.

Parameters
[in]buff_sizeThe desired size of the buffer

Definition at line 463 of file image_warp_util.cpp.

◆ WarpPoints()

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.

Parameters
[in]points_inThe input points matrix
[out]points_outThe output points matrix
[in]image_sizeThe corresponding image size
[in]use_medianSpecify whether to use median or mean values, default is use_median = true

Definition at line 475 of file image_warp_util.cpp.

Member Data Documentation

◆ mean_pitch_

double swri_image_util::PitchAndRollEstimatorQueue::mean_pitch_
private

Definition at line 300 of file image_warp_util.h.

◆ mean_roll_

double swri_image_util::PitchAndRollEstimatorQueue::mean_roll_
private

Definition at line 301 of file image_warp_util.h.

◆ median_pitch_

double swri_image_util::PitchAndRollEstimatorQueue::median_pitch_
private

Definition at line 302 of file image_warp_util.h.

◆ median_roll_

double swri_image_util::PitchAndRollEstimatorQueue::median_roll_
private

Definition at line 303 of file image_warp_util.h.

◆ pitches_

boost::circular_buffer<double> swri_image_util::PitchAndRollEstimatorQueue::pitches_
private

Definition at line 297 of file image_warp_util.h.

◆ rolls_

boost::circular_buffer<double> swri_image_util::PitchAndRollEstimatorQueue::rolls_
private

Definition at line 298 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 Sat Jan 21 2023 03:13:20