Inheritance diagram for w2kmeans::HSMotionEstimator< GridType >:
Public Member Functions | |
HSMotionEstimator (size_t maxVelocityInMetersPerSecond=20, size_t templateRadiusInKilometers=3) | |
virtual bool | computeMotionEstimate (const GridType &oldImage, const GridType &newImage, int maxMotion_x, int maxMotion_y, const ScaleCalculator< GridType > &) |
Computes the pixel movement that if present in the oldImage would have made that image most similar to this one. | |
virtual | ~HSMotionEstimator () |
void | setMinimumThreshold (double newThresh) |
changes the minimum threshold from the default of 20 | |
void | setGoodnessFraction (double newFrac) |
What fraction of the pixels in the neigborhood have to be valid before motion estimation is done at that pixel? By default, this is 0.5. | |
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 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. | |
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 void | preprocessInputData (GridType &image) |
thresholds and sets all values below minThresh to be missing. | |
virtual code::SmartPtr< code::DataType > | computeMotionFromGrid (const GridType &oldData) |
virtual void | ageOff () |
called after the motion estimating is done. | |
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 | |
const double | templateRadius |
double | minThresh |
double | goodnessThreshold |
int | halfSize_x |
int | halfSize_y |
GridType | myXmovement |
result of computeMotionEstimate. | |
GridType | myYmovement |
result of computeMotionEstimate. | |
GridType | myRateOfIncrease |
result of computeMotionEstimate. | |
size_t | myScale |
code::SmartPtr< code::DataType > | myResult |
w2kmeans::HSMotionEstimator< GridType >::HSMotionEstimator | ( | size_t | maxVelocityInMetersPerSecond = 20 , |
|
size_t | templateRadiusInKilometers = 3 | |||
) |
virtual w2kmeans::HSMotionEstimator< GridType >::~HSMotionEstimator | ( | ) | [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, inherited] |
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 | ) | [inherited] |
implemented for several code 2D data types.
virtual bool w2kmeans::HSMotionEstimator< GridType >::computeMotionEstimate | ( | const GridType & | oldImage, | |
const GridType & | newImage, | |||
int | maxMotion_x, | |||
int | maxMotion_y, | |||
const ScaleCalculator< GridType > & | ||||
) | [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. |
Reimplemented from w2kmeans::ImageMotionEstimator< GridType >.
virtual code::SmartPtr<code::DataType> w2kmeans::MotionEstimator< GridType >::computeMotionFromGrid | ( | const GridType & | oldData | ) | [protected, virtual, inherited] |
virtual code::SmartPtr<code::DataType> w2kmeans::ImageMotionEstimator< GridType >::computeMotionFromGrids | ( | const GridType & | oldData, | |
const GridType & | newData | |||
) | [protected, virtual, inherited] |
Reimplemented from w2kmeans::MotionEstimator< GridType >.
bool w2kmeans::MotionEstimator< GridType >::estimateBestMovement | ( | const code::Image< float > & | error_field, | |
size_t | num_pixels_in_mask, | |||
double * | x, | |||
double * | y | |||
) | [protected, inherited] |
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, inherited] |
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 & | ) | [inherited] |
virtual std::vector< code::SmartPtr<code::DataType> > w2kmeans::MotionEstimator< GridType >::getIntermediateOutputs | ( | const GridType & | currData, | |
const GridType & | ux, | |||
const GridType & | uy | |||
) | const [inline, virtual, inherited] |
Reimplemented in w2kmeans::SegmentMotionEstimator< GridType >.
const GridType& w2kmeans::MotionEstimator< GridType >::getModel_U | ( | ) | const [inline, protected, inherited] |
const GridType& w2kmeans::MotionEstimator< GridType >::getModel_V | ( | ) | const [inline, protected, inherited] |
const code::Time& w2kmeans::MotionEstimator< GridType >::getPreviousComputationTime | ( | ) | const [inline, protected, inherited] |
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, inherited] |
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, inherited] |
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, inherited] |
virtual void w2kmeans::MotionEstimator< GridType >::initResults | ( | const GridType & | newdata | ) | [virtual, inherited] |
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::ImageMotionEstimator< GridType >::preprocessInputData | ( | GridType & | image | ) | [protected, virtual, inherited] |
thresholds and sets all values below minThresh to be missing.
Reimplemented from w2kmeans::MotionEstimator< 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 | ) | [inherited] |
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::ImageMotionEstimator< GridType >::setGoodnessFraction | ( | double | newFrac | ) | [inline, inherited] |
What fraction of the pixels in the neigborhood have to be valid before motion estimation is done at that pixel? By default, this is 0.5.
void w2kmeans::ImageMotionEstimator< GridType >::setMinimumThreshold | ( | double | newThresh | ) | [inline, inherited] |
changes the minimum threshold from the default of 20
void w2kmeans::MotionEstimator< GridType >::setMinimumTimeBetweenEstimates | ( | int | newMinimumTimeDiffInSeconds | ) | [inherited] |
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 | ) | [inherited] |
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, inherited] |
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, inherited] |
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, inherited] |
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, inherited] |
are we ready to process the next input or are we waiting .
..
Reimplemented from w2kmeans::MotionEstimateSupplier< GridType >.
double w2kmeans::ImageMotionEstimator< GridType >::goodnessThreshold [protected, inherited] |
int w2kmeans::ImageMotionEstimator< GridType >::halfSize_x [mutable, protected, inherited] |
int w2kmeans::ImageMotionEstimator< GridType >::halfSize_y [mutable, protected, inherited] |
double w2kmeans::ImageMotionEstimator< GridType >::minThresh [protected, inherited] |
GridType w2kmeans::MotionEstimator< GridType >::myRateOfIncrease [protected, inherited] |
result of computeMotionEstimate.
code::SmartPtr<code::DataType> w2img::Data2DFilter::myResult [protected, inherited] |
size_t w2kmeans::MotionEstimator< GridType >::myScale [protected, inherited] |
GridType w2kmeans::MotionEstimator< GridType >::myXmovement [protected, inherited] |
result of computeMotionEstimate.
GridType w2kmeans::MotionEstimator< GridType >::myYmovement [protected, inherited] |
result of computeMotionEstimate.
const double w2kmeans::ImageMotionEstimator< GridType >::templateRadius [protected, inherited] |