w2img::BlobFilter Class Reference

Inheritance diagram for w2img::BlobFilter:

w2img::GMMFilter w2img::ImageFilter w2img::SingleData2DFilter w2img::Data2DFilter List of all members.

Detailed Description

This allows you to find blobs in the image, filter them on size and fit a Gaussian Mixture Model (GMM) to them.

Author:
Lakshman
Version:
Id
w2img_BlobFilter.h,v 1.4 2009/08/07 15:52:53 lakshman Exp


Public Member Functions

 BlobFilter (float minThresh, float maxThresh, float incr, int minSize, int mxGMMPerBlob)
virtual ~BlobFilter ()
virtual code::Image< float > filterImage (const code::Image< float > &data)
 the work-horse function.
const std::vector< GMM > & getFittedGMMs () const
virtual code::Image< float > recreateImage (int dimx, int dimy)
 use the computed GMM to recreate an image with these dimensions.
virtual code::Image< float > recreateImage (const std::vector< GMM > &gmm, int dimx, int dimy)
 use the supplied GMM to recreate an image with these dimensions.
virtual code::SmartPtr< code::DataType > filter (const code::RadialSet &)
virtual code::SmartPtr< code::DataType > filter (const code::CartesianGrid2D &)
virtual code::SmartPtr< code::DataType > filter (const code::LatLonGrid &)
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 ()

Static Public Member Functions

static code::Image< int > findBlobs (const code::Image< float > &data, float minThresh, std::vector< int > &blobsize, int minSize, std::vector< std::vector< short > > *xbyreg, std::vector< std::vector< short > > *ybreg)
 Helper function to find blobs.
static code::Image< int > findBlobs (const code::Image< float > &data, float minThresh, std::vector< int > &blobsize)
 Helper function to find blobs.

Protected Attributes

float minThresh
float maxThresh
float incr
std::vector< GMM > allGMM
code::SmartPtr< code::DataType > myResult


Constructor & Destructor Documentation

w2img::BlobFilter::BlobFilter ( float  minThresh,
float  maxThresh,
float  incr,
int  minSize,
int  mxGMMPerBlob 
)

Parameters:
minThresh values < minThresh are treated as missing
maxThresh values > maxThresh are treated as max
incr increment, to quantize the values into integers
minBlobSize Minimum number of pixels in blob
maxGMMPerBlob How many GMM are allowed per blob? Specify -ve to not replace blobs by GMM; specify 0 to auto-estimate based on Bayes Information Criterion
Wrapping around of radials is NOT supported, so you should not use this filter on radial sets.

virtual w2img::BlobFilter::~BlobFilter (  )  [virtual]


Member Function Documentation

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.

virtual code::SmartPtr<code::DataType> w2img::ImageFilter::filter ( const code::LatLonGrid &   )  [virtual, inherited]

Implements w2img::SingleData2DFilter.

Reimplemented in w2img::DistanceFilter.

virtual code::SmartPtr<code::DataType> w2img::ImageFilter::filter ( const code::CartesianGrid2D &   )  [virtual, inherited]

Implements w2img::SingleData2DFilter.

Reimplemented in w2img::DistanceFilter.

virtual code::SmartPtr<code::DataType> w2img::ImageFilter::filter ( const code::RadialSet &   )  [virtual, inherited]

Implements w2img::SingleData2DFilter.

Reimplemented in w2img::DistanceFilter.

virtual code::Image<float> w2img::BlobFilter::filterImage ( const code::Image< float > &  data  )  [virtual]

the work-horse function.

Implements w2img::ImageFilter.

static code::Image<int> w2img::BlobFilter::findBlobs ( const code::Image< float > &  data,
float  minThresh,
std::vector< int > &  blobsize 
) [inline, static]

Helper function to find blobs.

Returns the labels in the image. More convenient form when you don't need want the pixel list.

static code::Image<int> w2img::BlobFilter::findBlobs ( const code::Image< float > &  data,
float  minThresh,
std::vector< int > &  blobsize,
int  minSize,
std::vector< std::vector< short > > *  xbyreg,
std::vector< std::vector< short > > *  ybreg 
) [static]

Helper function to find blobs.

Returns the labels in the image. You can also request the x,y of each of the blobs above a certain size.

const std::vector<GMM>& w2img::GMMFilter::getFittedGMMs (  )  const [inline, 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.

size_t w2img::SingleData2DFilter::getWrapAroundRadials (  )  const [inline, virtual, inherited]

Implements w2img::Data2DFilter.

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.

virtual code::Image<float> w2img::GMMFilter::recreateImage ( const std::vector< GMM > &  gmm,
int  dimx,
int  dimy 
) [virtual, inherited]

use the supplied GMM to recreate an image with these dimensions.

Because the GMM stores pixel locations only, these need to be the dimensions of the original image.

virtual code::Image<float> w2img::GMMFilter::recreateImage ( int  dimx,
int  dimy 
) [inline, virtual, inherited]

use the computed GMM to recreate an image with these dimensions.

Because the GMM stores pixel locations only, these need to be the dimensions of the original image.

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 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.


Member Data Documentation

std::vector<GMM> w2img::GMMFilter::allGMM [protected, inherited]

float w2img::GMMFilter::incr [protected, inherited]

float w2img::GMMFilter::maxThresh [protected, inherited]

float w2img::GMMFilter::minThresh [protected, inherited]

code::SmartPtr<code::DataType> w2img::Data2DFilter::myResult [protected, inherited]


Generated on Fri May 4 13:40:23 2012 for WDSS-IIw2algs by  doxygen 1.4.7