Inheritance diagram for w2kmeans::MotionEstimator< GridType >:
It implements the MotionEstimateHandler interface so that the estimator can be seeded with results from another estimator.
Public Member Functions | |
MotionEstimator (size_t maxVelocityInMetersPerSecond=20) | |
void | setModelWindField (code::SmartPtr< code::WindFieldStruct< GridType > > wf) |
Set background (model) estimate. | |
code::SmartPtr< code::WindFieldStruct< GridType > > | remap (const code::WindFieldStruct< GridType > &orig) |
void | handleMotionEstimate (const GridType &east, const GridType &south, const GridType &rateOfIncrease, size_t scale, bool complete) |
We will use the result from scale = myScale -1 as the seed for this one. | |
void | setMinimumTimeBetweenFrames (int newMinimumTimeDiffInSeconds) |
Specify the minimum time that should have elapsed between frames for them to be used in motion computation. | |
void | setMinimumTimeBetweenEstimates (int newMinimumTimeDiffInSeconds) |
Specify the minimum time that should have elapsed between motion estimates. | |
virtual bool | computeMotionEstimate (const GridType &oldImage, const GridType &newImage, int maxMotion_x, int maxMotion_y, const ScaleCalculator< GridType > &)=0 |
Computes the pixel movement that if present in the oldImage would have made that image most similar to this one. | |
virtual std::vector< code::SmartPtr< code::DataType > > | getIntermediateOutputs (const GridType &currData, const GridType &ux, const GridType &uy) const |
virtual bool | shouldProcessInputAt (const code::Time &newTime) const |
are we ready to process the next input or are we waiting . | |
virtual void | initResults (const GridType &newdata) |
the base-class method initializes the xmovement, ymovement and growth rate to missing/zero. | |
void | setQuantizationLevel (double newLevel) |
Set the motion vectors to be quantized to this level. | |
void | setPostprocessingFilter (code::SmartPtr< w2img::ImageFilter > newFilter) |
Add a postprocessing filter on the motion estimates. | |
template<class X> | |
code::SmartPtr< code::DataType > | computeMotion (const w2img::GeographicData2DAdapter< X > &data) |
implemented for several code 2D data types. | |
virtual | ~MotionEstimator () |
code::SmartPtr< code::DataType > | filter (const GridType &) |
code::SmartPtr< code::DataType > | filter (const code::LatLonGrid &) |
code::SmartPtr< code::DataType > | filter (const code::RadialSet &) |
code::SmartPtr< code::DataType > | filter (const code::CartesianGrid2D &) |
void | process (code::PolarGrid &) |
Note that you need to call getResult() to get the result. | |
void | process (code::RadialSet &) |
Note that you need to call getResult() to get the result. | |
void | process (code::CartesianGrid2D &) |
Note that you need to call getResult() to get the result. | |
void | process (code::LatLonGrid &) |
Note that you need to call getResult() to get the result. | |
void | process (code::WindFieldStruct< code::LatLonGrid > &) |
Note that you need to call getResult() to get the result. | |
void | process (code::WindFieldStruct< code::CartesianGrid2D > &) |
Note that you need to call getResult() to get the result. | |
void | allowChangingMissingData (bool in) |
Should we filter at missing data values also, or not process missing values? By default, smoothing around a missing value might produce a value at that point in the result i.e. | |
bool | canChangeMissing () const |
void | setToHandleRadialData (bool in) |
Pass in true if radial data should be filtered directly instead, of as is default, to convert to CartesianGrid before contouring. | |
void | setCartesianGridResolutionRatio (double inres) |
changes the grid resolution of CartesianGrids created from RadialSets from that of the gate width. | |
void | setCartesianGridDimension (const code::Length &indim) |
clips cartesian grids to this extent in the horizontal and vertical directions. | |
void | setWrapAroundRadials (size_t numWrapAroundRadials) |
Normally, the RadialSet processing is done with no radial "wrapping". | |
size_t | getWrapAroundRadials () const |
code::SmartPtr< code::DataType > | getResult () |
get the result of the filtering -- returns 0 on error. | |
void | reset () |
void | addMotionEstimateHandler (code::SmartPtr< MotionEstimateHandler< GridType > > a) |
Add an estimate handler. | |
bool | isProcessing () const |
returns true while processing the input, and false if waiting for new inputs. | |
virtual void | handleIntermediateProduct (const code::DataType &prod) |
Protected Member Functions | |
virtual code::SmartPtr< code::DataType > | computeMotionFromGrids (const GridType &oldData, const GridType &newData) |
virtual code::SmartPtr< code::DataType > | computeMotionFromGrid (const GridType &oldData) |
virtual void | ageOff () |
called after the motion estimating is done. | |
virtual void | preprocessInputData (GridType &image) |
over-ride to preprocess the image if required. | |
bool | estimateBestMovement (const code::Image< float > &error_field, size_t num_pixels_in_mask, double *x, double *y) |
Fills in the row and column corresponding to the minimization of the error field. | |
virtual void | fillMissingMovement (GridType &x, GridType &y, GridType &gr, const ScaleCalculator< GridType > &) |
The default behavior is to fill the missing movement with the global mean. | |
const code::Time & | getPreviousComputationTime () const |
int | getTimeBetweenFrames () const |
in seconds. | |
bool | hasModelWindField () const |
const GridType & | getModel_U () const |
const GridType & | getModel_V () const |
void | notifyMotionEstimate (const GridType &motionEast, const GridType &motionSouth, const GridType &growthRate, size_t scale, bool complete) |
subclass implementors should call this method when they have this information. | |
void | notifyIntermediateProduct (const code::DataType &grid) |
this method may be called for handlers who write out intermediate products. | |
void | setProcessingFlag (bool input) |
Protected Attributes | |
GridType | myXmovement |
result of computeMotionEstimate. | |
GridType | myYmovement |
result of computeMotionEstimate. | |
GridType | myRateOfIncrease |
result of computeMotionEstimate. | |
size_t | myScale |
code::SmartPtr< code::DataType > | myResult |
w2kmeans::MotionEstimator< GridType >::MotionEstimator | ( | size_t | maxVelocityInMetersPerSecond = 20 |
) |
virtual w2kmeans::MotionEstimator< GridType >::~MotionEstimator | ( | ) | [virtual] |
void w2kmeans::MotionEstimateSupplier< GridType >::addMotionEstimateHandler | ( | code::SmartPtr< MotionEstimateHandler< GridType > > | a | ) | [inline, inherited] |
Add an estimate handler.
we will call handleMotionEstimate on this object whenever we generate a new motion estimate.
virtual void w2kmeans::MotionEstimator< GridType >::ageOff | ( | ) | [protected, virtual] |
called after the motion estimating is done.
the new data is oldData.back() at this point.
void w2img::SingleData2DFilter::allowChangingMissingData | ( | bool | in | ) | [inline, virtual, inherited] |
Should we filter at missing data values also, or not process missing values? By default, smoothing around a missing value might produce a value at that point in the result i.e.
the bool is true.
Implements w2img::Data2DFilter.
bool w2img::SingleData2DFilter::canChangeMissing | ( | ) | const [inline, virtual, inherited] |
Implements w2img::Data2DFilter.
code::SmartPtr<code::DataType> w2kmeans::MotionEstimator< GridType >::computeMotion | ( | const w2img::GeographicData2DAdapter< X > & | data | ) |
implemented for several code 2D data types.
virtual bool w2kmeans::MotionEstimator< GridType >::computeMotionEstimate | ( | const GridType & | oldImage, | |
const GridType & | newImage, | |||
int | maxMotion_x, | |||
int | maxMotion_y, | |||
const ScaleCalculator< GridType > & | ||||
) | [pure virtual] |
Computes the pixel movement that if present in the oldImage would have made that image most similar to this one.
maxMotion | -- how many pixels we are allowed to move the local template in order to get a match. | |
halfSize | -- half size of the local template used to compute the match. |
Implemented in w2kmeans::HSMotionEstimator< GridType >, w2kmeans::ImageMotionEstimator< GridType >, w2kmeans::KLTMotionEstimator< GridType >, and w2kmeans::SegmentMotionEstimator< GridType >.
virtual code::SmartPtr<code::DataType> w2kmeans::MotionEstimator< GridType >::computeMotionFromGrid | ( | const GridType & | oldData | ) | [protected, virtual] |
virtual code::SmartPtr<code::DataType> w2kmeans::MotionEstimator< GridType >::computeMotionFromGrids | ( | const GridType & | oldData, | |
const GridType & | newData | |||
) | [protected, virtual] |
Reimplemented in w2kmeans::ImageMotionEstimator< GridType >.
bool w2kmeans::MotionEstimator< GridType >::estimateBestMovement | ( | const code::Image< float > & | error_field, | |
size_t | num_pixels_in_mask, | |||
double * | x, | |||
double * | y | |||
) | [protected] |
Fills in the row and column corresponding to the minimization of the error field.
virtual void w2kmeans::MotionEstimator< GridType >::fillMissingMovement | ( | GridType & | x, | |
GridType & | y, | |||
GridType & | gr, | |||
const ScaleCalculator< GridType > & | ||||
) | [protected, virtual] |
The default behavior is to fill the missing movement with the global mean.
The global mean is in m/s. The scale calculator is provided incase subclasses need to compute m/s from pixels/frame
Reimplemented in w2kmeans::SegmentMotionEstimator< GridType >.
code::SmartPtr<code::DataType> w2kmeans::DefaultGridFilter::filter | ( | const code::CartesianGrid2D & | ) | [virtual, inherited] |
Implements w2img::SingleData2DFilter.
code::SmartPtr<code::DataType> w2kmeans::DefaultGridFilter::filter | ( | const code::RadialSet & | ) | [virtual, inherited] |
Implements w2img::SingleData2DFilter.
code::SmartPtr<code::DataType> w2kmeans::DefaultGridFilter::filter | ( | const code::LatLonGrid & | ) | [virtual, inherited] |
Implements w2img::SingleData2DFilter.
code::SmartPtr<code::DataType> w2kmeans::MotionEstimator< GridType >::filter | ( | const GridType & | ) |
virtual std::vector< code::SmartPtr<code::DataType> > w2kmeans::MotionEstimator< GridType >::getIntermediateOutputs | ( | const GridType & | currData, | |
const GridType & | ux, | |||
const GridType & | uy | |||
) | const [inline, virtual] |
Reimplemented in w2kmeans::SegmentMotionEstimator< GridType >.
const GridType& w2kmeans::MotionEstimator< GridType >::getModel_U | ( | ) | const [inline, protected] |
const GridType& w2kmeans::MotionEstimator< GridType >::getModel_V | ( | ) | const [inline, protected] |
const code::Time& w2kmeans::MotionEstimator< GridType >::getPreviousComputationTime | ( | ) | const [inline, protected] |
code::SmartPtr<code::DataType> w2img::Data2DFilter::getResult | ( | ) | [inline, inherited] |
get the result of the filtering -- returns 0 on error.
This may or may not be the same data as passed in, for example process(RadialSet) may return a CartesianGrid.
int w2kmeans::MotionEstimator< GridType >::getTimeBetweenFrames | ( | ) | const [inline, protected] |
in seconds.
size_t w2img::SingleData2DFilter::getWrapAroundRadials | ( | ) | const [inline, virtual, inherited] |
Implements w2img::Data2DFilter.
virtual void w2kmeans::MotionEstimateHandler< GridType >::handleIntermediateProduct | ( | const code::DataType & | prod | ) | [virtual, inherited] |
void w2kmeans::MotionEstimator< GridType >::handleMotionEstimate | ( | const GridType & | east, | |
const GridType & | south, | |||
const GridType & | rateOfIncrease, | |||
size_t | scale, | |||
bool | complete | |||
) | [virtual] |
We will use the result from scale = myScale -1 as the seed for this one.
(If we are not attached, a MISSING_DATA will be used).
Implements w2kmeans::MotionEstimateHandler< GridType >.
bool w2kmeans::MotionEstimator< GridType >::hasModelWindField | ( | ) | const [inline, protected] |
virtual void w2kmeans::MotionEstimator< GridType >::initResults | ( | const GridType & | newdata | ) | [virtual] |
the base-class method initializes the xmovement, ymovement and growth rate to missing/zero.
Reimplemented in w2kmeans::SegmentMotionEstimator< GridType >.
bool w2kmeans::MotionEstimateSupplier< GridType >::isProcessing | ( | ) | const [inline, inherited] |
returns true while processing the input, and false if waiting for new inputs.
void w2kmeans::MotionEstimateSupplier< GridType >::notifyIntermediateProduct | ( | const code::DataType & | grid | ) | [protected, inherited] |
this method may be called for handlers who write out intermediate products.
void w2kmeans::MotionEstimateSupplier< GridType >::notifyMotionEstimate | ( | const GridType & | motionEast, | |
const GridType & | motionSouth, | |||
const GridType & | growthRate, | |||
size_t | scale, | |||
bool | complete | |||
) | [protected, inherited] |
subclass implementors should call this method when they have this information.
virtual void w2kmeans::MotionEstimator< GridType >::preprocessInputData | ( | GridType & | image | ) | [protected, virtual] |
over-ride to preprocess the image if required.
Reimplemented in w2kmeans::ImageMotionEstimator< GridType >.
void w2img::SingleData2DFilter::process | ( | code::WindFieldStruct< code::CartesianGrid2D > & | ) | [inherited] |
Note that you need to call getResult() to get the result.
The input data is not changed.
void w2img::SingleData2DFilter::process | ( | code::WindFieldStruct< code::LatLonGrid > & | ) | [inherited] |
Note that you need to call getResult() to get the result.
The input data is not changed.
void w2img::SingleData2DFilter::process | ( | code::LatLonGrid & | ) | [inherited] |
Note that you need to call getResult() to get the result.
The input data is not changed.
void w2img::SingleData2DFilter::process | ( | code::CartesianGrid2D & | ) | [inherited] |
Note that you need to call getResult() to get the result.
The input data is not changed.
void w2img::SingleData2DFilter::process | ( | code::RadialSet & | ) | [inherited] |
Note that you need to call getResult() to get the result.
The input data is not changed.
void w2img::SingleData2DFilter::process | ( | code::PolarGrid & | ) | [inherited] |
Note that you need to call getResult() to get the result.
The input data is not changed.
code::SmartPtr<code::WindFieldStruct<GridType> > w2kmeans::MotionEstimator< GridType >::remap | ( | const code::WindFieldStruct< GridType > & | orig | ) |
void w2img::Data2DFilter::reset | ( | ) | [inline, inherited] |
void w2img::SingleData2DFilter::setCartesianGridDimension | ( | const code::Length & | indim | ) | [inline, virtual, inherited] |
clips cartesian grids to this extent in the horizontal and vertical directions.
(Removes the boundaries, keeping the image centered at the same spot).
by default, no such clipping is done. Pass in Length() to turn off clipping.
Implements w2img::Data2DFilter.
void w2img::SingleData2DFilter::setCartesianGridResolutionRatio | ( | double | inres | ) | [inline, virtual, inherited] |
changes the grid resolution of CartesianGrids created from RadialSets from that of the gate width.
For example, if the RadialSet's gate width is 1km, then if the ratio is 3, the CartesianGrid's resolution is 0.33km. If the input ratio is 0.33 then the grid resolution will be 3km.
Implements w2img::Data2DFilter.
void w2kmeans::MotionEstimator< GridType >::setMinimumTimeBetweenEstimates | ( | int | newMinimumTimeDiffInSeconds | ) |
Specify the minimum time that should have elapsed between motion estimates.
The default is -1, i.e. always do computations.
void w2kmeans::MotionEstimator< GridType >::setMinimumTimeBetweenFrames | ( | int | newMinimumTimeDiffInSeconds | ) |
Specify the minimum time that should have elapsed between frames for them to be used in motion computation.
a non-positive value indicates that successive frames should be used regardless of the time difference.
void w2kmeans::MotionEstimator< GridType >::setModelWindField | ( | code::SmartPtr< code::WindFieldStruct< GridType > > | wf | ) | [inline] |
Set background (model) estimate.
This background field should have been remapped to fit the dimensions of the tracked product.
void w2kmeans::MotionEstimator< GridType >::setPostprocessingFilter | ( | code::SmartPtr< w2img::ImageFilter > | newFilter | ) | [inline] |
Add a postprocessing filter on the motion estimates.
by default, there is no postprocessing done on these.
void w2kmeans::MotionEstimateSupplier< GridType >::setProcessingFlag | ( | bool | input | ) | [inline, protected, inherited] |
void w2kmeans::MotionEstimator< GridType >::setQuantizationLevel | ( | double | newLevel | ) | [inline] |
Set the motion vectors to be quantized to this level.
For example, if newLevel = 5, the resulting estimates will be one of 0, 5, 10, etc. If newLevel is -ve, quantization is turned off.
the default is set for no quantization.
void w2img::SingleData2DFilter::setToHandleRadialData | ( | bool | in | ) | [inline, virtual, inherited] |
Pass in true if radial data should be filtered directly instead, of as is default, to convert to CartesianGrid before contouring.
Implements w2img::Data2DFilter.
void w2img::SingleData2DFilter::setWrapAroundRadials | ( | size_t | numWrapAroundRadials | ) | [inline, virtual, inherited] |
Normally, the RadialSet processing is done with no radial "wrapping".
You can remove boundary effects in the azimuthal direction by calling this function with a value greater than zero.
When filtering with a 5x5 kernel, this class will automatically add 5 radials, do the filtering and then remove the extra five radials. In that case, the number of wraparound radials should be set to 5.
Implements w2img::Data2DFilter.
virtual bool w2kmeans::MotionEstimator< GridType >::shouldProcessInputAt | ( | const code::Time & | newTime | ) | const [virtual] |
are we ready to process the next input or are we waiting .
..
Reimplemented from w2kmeans::MotionEstimateSupplier< GridType >.
GridType w2kmeans::MotionEstimator< GridType >::myRateOfIncrease [protected] |
result of computeMotionEstimate.
code::SmartPtr<code::DataType> w2img::Data2DFilter::myResult [protected, inherited] |
size_t w2kmeans::MotionEstimator< GridType >::myScale [protected] |
GridType w2kmeans::MotionEstimator< GridType >::myXmovement [protected] |
result of computeMotionEstimate.
GridType w2kmeans::MotionEstimator< GridType >::myYmovement [protected] |
result of computeMotionEstimate.