Inheritance diagram for w2kmeans::SegmentMotionEstimator< GridType >:
Uses the minimum mean absolute error, then uses a gravitational field of these clusters to derive a final motion estimate.
Public Member Functions | |
SegmentMotionEstimator (code::InitSmartPtr< MultiscaleSegmenter > segmenter, size_t scaleToProcess, const code::URL &cluster_xml, size_t maxVelocityInMetersPerSecond=20) | |
Pass in the segmenter and the scale that this estimator is required to process (0 for most detailed, 1 for less, 2 for even coarser, etc. | |
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 | ~SegmentMotionEstimator () |
void | addClusterTableData (const code::Index::Record &rec) |
Add index record from which to extract extra cluster field to add into table properties. | |
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 | shouldProcessInputAt (const code::Time &newTime) const |
are we ready to process the next input or are we waiting . | |
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) |
Static Public Member Functions | |
static void | setModelDataWeight (float h) |
Protected Member Functions | |
virtual std::vector< code::SmartPtr< code::DataType > > | getIntermediateOutputs (const GridType &currData, const GridType &ux, const GridType &uy) const |
returns the K-Means image. | |
virtual void | initResults (const GridType &newdata) |
adds | |
void | fillMissingMovement (GridType &x, GridType &y, GridType &gr, const ScaleCalculator< GridType > &) |
Changes not just missing movements, but all movements, by using our gravitational field. | |
void | estimateMovementAtEachPixel (const std::vector< Region > ®ions, const std::vector< OldRegion > &oldRegions, const RegionsWeight &weights, GridType &ux, GridType &uy, GridType &gr) |
the old regions should not include any background region. | |
void | createClusterFieldsFromRecords () |
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. | |
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 |
Classes | |
struct | KalmanFilter |
struct | OldRegion |
class | RegionsWeight |
Computes the relative weight of each region. More... |
w2kmeans::SegmentMotionEstimator< GridType >::SegmentMotionEstimator | ( | code::InitSmartPtr< MultiscaleSegmenter > | segmenter, | |
size_t | scaleToProcess, | |||
const code::URL & | cluster_xml, | |||
size_t | maxVelocityInMetersPerSecond = 20 | |||
) |
Pass in the segmenter and the scale that this estimator is required to process (0 for most detailed, 1 for less, 2 for even coarser, etc.
)
virtual w2kmeans::SegmentMotionEstimator< GridType >::~SegmentMotionEstimator | ( | ) | [virtual] |
void w2kmeans::SegmentMotionEstimator< GridType >::addClusterTableData | ( | const code::Index::Record & | rec | ) | [inline] |
Add index record from which to extract extra cluster field to add into table properties.
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::SegmentMotionEstimator< 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. |
Implements w2kmeans::MotionEstimator< GridType >.
virtual code::SmartPtr<code::DataType> w2kmeans::MotionEstimator< GridType >::computeMotionFromGrid | ( | const GridType & | oldData | ) | [protected, virtual, inherited] |
virtual code::SmartPtr<code::DataType> w2kmeans::MotionEstimator< GridType >::computeMotionFromGrids | ( | const GridType & | oldData, | |
const GridType & | newData | |||
) | [protected, virtual, inherited] |
Reimplemented in w2kmeans::ImageMotionEstimator< GridType >.
void w2kmeans::SegmentMotionEstimator< GridType >::createClusterFieldsFromRecords | ( | ) | [protected] |
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.
void w2kmeans::SegmentMotionEstimator< GridType >::estimateMovementAtEachPixel | ( | const std::vector< Region > & | regions, | |
const std::vector< OldRegion > & | oldRegions, | |||
const RegionsWeight & | weights, | |||
GridType & | ux, | |||
GridType & | uy, | |||
GridType & | gr | |||
) | [protected] |
the old regions should not include any background region.
void w2kmeans::SegmentMotionEstimator< GridType >::fillMissingMovement | ( | GridType & | x, | |
GridType & | y, | |||
GridType & | gr, | |||
const ScaleCalculator< GridType > & | ||||
) | [protected, virtual] |
Changes not just missing movements, but all movements, by using our gravitational field.
Reimplemented from w2kmeans::MotionEstimator< 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::SegmentMotionEstimator< GridType >::getIntermediateOutputs | ( | const GridType & | currData, | |
const GridType & | ux, | |||
const GridType & | uy | |||
) | const [protected, virtual] |
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::SegmentMotionEstimator< GridType >::initResults | ( | const GridType & | newdata | ) | [protected, virtual] |
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, inherited] |
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 | ) | [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::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.
static void w2kmeans::SegmentMotionEstimator< GridType >::setModelDataWeight | ( | float | h | ) | [inline, static] |
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 >.
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.