Creation of skeleton images. More...

#include <Skeleton.h>

Inheritance diagram for te::rp::Skeleton:
te::rp::Algorithm

Classes

class  ApplyVecDiffusionThreadParams
 
class  InputParameters
 Skeleton input parameters. More...
 
class  OutputParameters
 Skeleton output parameters. More...
 

Public Member Functions

bool execute (AlgorithmOutputParameters &outputParams) throw ( te::rp::Exception )
 Executes the algorithm using the supplied parameters. More...
 
bool initialize (const AlgorithmInputParameters &inputParams) throw ( te::rp::Exception )
 Initialize the algorithm instance making it ready for execution. More...
 
bool isInitialized () const
 Returns true if the algorithm instance is initialized and ready for execution. More...
 
void reset () throw ( te::rp::Exception )
 Clear all internal allocated objects and reset the algorithm to its initial state. More...
 
 Skeleton ()
 
 ~Skeleton ()
 

Protected Member Functions

template<typename MatrixElementT >
bool applyMeanSmooth (const te::rp::Matrix< MatrixElementT > &input, te::rp::Matrix< MatrixElementT > &output) const
 Apply a mean filter. More...
 
bool applyVecDiffusion (const te::rp::Matrix< double > &inputX, const te::rp::Matrix< double > &inputY, te::rp::Matrix< double > const *const backgroundDataPtr, te::common::TaskProgress *progressPtr, te::rp::Matrix< double > &outputX, te::rp::Matrix< double > &outputY) const
 Apply a vector diffusion over the given vector field. More...
 
bool createSkeletonStrengthMap (const te::rp::Matrix< double > &inputX, const te::rp::Matrix< double > &inputY, const te::rp::Matrix< double > &edgeStrengthMap, te::rp::Matrix< double > &skelMap) const
 Create a skeleton strength map. More...
 
void createTifFromVecField (const te::rp::Matrix< double > &inputVecFieldX, const te::rp::Matrix< double > &inputVecFieldY, te::rp::Matrix< double > const *const backGroundMapPtr, const unsigned int vecPixelStep, const std::string &tifFileName) const
 Create a tiff file from a vector field. More...
 
bool getEdgeStrengthMap (const te::rp::Matrix< double > &inputMap, te::rp::Matrix< double > &edgeStrengthMap) const
 Create an Edge strenght Map from the input data. More...
 
bool getGradientMaps (const te::rp::Matrix< double > &inputData, const bool unitVectors, te::rp::Matrix< double > &gradXMap, te::rp::Matrix< double > &gradYMap) const
 Create an gradient maps from the input image. More...
 
template<typename MatrixElementT >
bool getMagnitude (const te::rp::Matrix< double > &xMap, const te::rp::Matrix< double > &yMap, te::rp::Matrix< MatrixElementT > &magnitude) const
 Generate the magnitude map from the input vectors. More...
 
bool loadData (te::rp::Matrix< double > &rasterData) const
 Load data from the input raster. More...
 

Static Protected Member Functions

static void applyVecDiffusionThreadEntry (ApplyVecDiffusionThreadParams *paramsPtr)
 Vector diffusion thread entry. More...
 

Protected Attributes

Skeleton::InputParameters m_inputParameters
 Input execution parameters. More...
 
bool m_isInitialized
 Tells if this instance is initialized. More...
 

Detailed Description

Creation of skeleton images.

The skeleton of a region may be defined via the media axis transformation MAT proposed by Blum [1967]. The MAT of a region R with border B is as follows: For each point p in R, we find its closest neightbor in B. If p has more than one such neighbor, it is said to belong to the medial axis (skeleton) of R.

Note
Reference: Blum, H. 1967. A transformation for extracting new descriptors of form.
Reference: Normalized Gradient Vector Diffusion and Image Segmentation, Zeyun Yu, Chandrajit Bajaj.
Reference: Image Segmentation Using Gradient Vector Diffusion and Region Merging, Zeyun Yu, Chandrajit Bajaj.
Reference: A Segmentation-Free Approach for Skeletonization of Gray-Scale Images via Anisotropic Vector Diffusion, Zeyun Yu and Chandrajit Bajaj.

Definition at line 70 of file Skeleton.h.

Constructor & Destructor Documentation

te::rp::Skeleton::Skeleton ( )
te::rp::Skeleton::~Skeleton ( )

Member Function Documentation

template<typename MatrixElementT >
bool te::rp::Skeleton::applyMeanSmooth ( const te::rp::Matrix< MatrixElementT > &  input,
te::rp::Matrix< MatrixElementT > &  output 
) const
inlineprotected

Apply a mean filter.

Parameters
inputThe input data.
outputThe output data.
Returns
true if OK, false on errors.

Definition at line 247 of file Skeleton.h.

References te::rp::Matrix< TemplateElementType >::getColumnsNumber(), te::rp::Matrix< TemplateElementType >::getLinesNumber(), and te::rp::Matrix< TemplateElementType >::reset().

bool te::rp::Skeleton::applyVecDiffusion ( const te::rp::Matrix< double > &  inputX,
const te::rp::Matrix< double > &  inputY,
te::rp::Matrix< double > const *const  backgroundDataPtr,
te::common::TaskProgress progressPtr,
te::rp::Matrix< double > &  outputX,
te::rp::Matrix< double > &  outputY 
) const
protected

Apply a vector diffusion over the given vector field.

Parameters
inputXThe vector decomposed X component;
inputYThe vector decomposed Y component;
backGroundMapPtrAn optional background image (0 means no background image).
progressPtrA pointer to a progress interface or an NULL pointer.
outputXThe diffused X component.
outputXThe diffused Y component.
static void te::rp::Skeleton::applyVecDiffusionThreadEntry ( ApplyVecDiffusionThreadParams paramsPtr)
staticprotected

Vector diffusion thread entry.

Parameters
paramsPtrA pointer to the thread parameters.
bool te::rp::Skeleton::createSkeletonStrengthMap ( const te::rp::Matrix< double > &  inputX,
const te::rp::Matrix< double > &  inputY,
const te::rp::Matrix< double > &  edgeStrengthMap,
te::rp::Matrix< double > &  skelMap 
) const
protected

Create a skeleton strength map.

The skeleton strength map is a scalar map defined on every pixel and indicates the likelihood of each pixel being on the skeletons.

Parameters
inputXThe vector decomposed X component;
inputYThe vector decomposed Y component;
edgeStrengthMapThe edge strength map (values between 0 and 1).
skelSMapThe skeleton map (values between 0 and 1).
Returns
true if ok, false on errors.
void te::rp::Skeleton::createTifFromVecField ( const te::rp::Matrix< double > &  inputVecFieldX,
const te::rp::Matrix< double > &  inputVecFieldY,
te::rp::Matrix< double > const *const  backGroundMapPtr,
const unsigned int  vecPixelStep,
const std::string &  tifFileName 
) const
protected

Create a tiff file from a vector field.

Parameters
inputVecFieldXThe vector decomposed X component;
inputVecFieldYThe vector decomposed Y component;
backGroundMapPtrAn optional background image (0 means no background image).
vecPixelStepThe step between each vector.
tifFileNameTif file name.
bool te::rp::Skeleton::execute ( AlgorithmOutputParameters outputParams)
throw (te::rp::Exception
)
virtual

Executes the algorithm using the supplied parameters.

Parameters
outputParamsOutput parameters.
Returns
true if OK, false on errors.

Implements te::rp::Algorithm.

bool te::rp::Skeleton::getEdgeStrengthMap ( const te::rp::Matrix< double > &  inputMap,
te::rp::Matrix< double > &  edgeStrengthMap 
) const
protected

Create an Edge strenght Map from the input data.

Parameters
inputMapThe input map.
edgeStrengthMapThe edge strength map (values between 0 and 1).
Returns
true if OK, false on errors.

The edge map have the property that the values are large near image boundaries and small within homogeneous regions.

bool te::rp::Skeleton::getGradientMaps ( const te::rp::Matrix< double > &  inputData,
const bool  unitVectors,
te::rp::Matrix< double > &  gradXMap,
te::rp::Matrix< double > &  gradYMap 
) const
protected

Create an gradient maps from the input image.

Parameters
inputDataThe input data.
unitVectorsIf true, unit vectors will be created.
gradXMapThe created gradient X vectors map.
gradYMapThe created gradient Y vectors map.
Returns
true if OK, false on errors.
template<typename MatrixElementT >
bool te::rp::Skeleton::getMagnitude ( const te::rp::Matrix< double > &  xMap,
const te::rp::Matrix< double > &  yMap,
te::rp::Matrix< MatrixElementT > &  magnitude 
) const
inlineprotected

Generate the magnitude map from the input vectors.

Parameters
xMapThe input data X component.
yMapThe input data Y component.
magnitudeThe magnitude output data.
Returns
true if OK, false on errors.

Definition at line 313 of file Skeleton.h.

References te::rp::Matrix< TemplateElementType >::getColumnsNumber(), te::rp::Matrix< TemplateElementType >::getLinesNumber(), and te::rp::Matrix< TemplateElementType >::reset().

bool te::rp::Skeleton::initialize ( const AlgorithmInputParameters inputParams)
throw (te::rp::Exception
)
virtual

Initialize the algorithm instance making it ready for execution.

Parameters
inputParamsInput parameters.
Returns
true if OK, false on errors.
Note
A return error string can be obtained via te::rp::Module::getLastLogStr()

Implements te::rp::Algorithm.

bool te::rp::Skeleton::isInitialized ( ) const
virtual

Returns true if the algorithm instance is initialized and ready for execution.

Returns
true if the algorithm instance is initialized and ready for execution.

Implements te::rp::Algorithm.

bool te::rp::Skeleton::loadData ( te::rp::Matrix< double > &  rasterData) const
protected

Load data from the input raster.

Parameters
rasterDataThe loaded data buffer.
Returns
true if OK, false on errors.
void te::rp::Skeleton::reset ( )
throw (te::rp::Exception
)
virtual

Clear all internal allocated objects and reset the algorithm to its initial state.

Implements te::rp::Algorithm.

Member Data Documentation

Skeleton::InputParameters te::rp::Skeleton::m_inputParameters
protected

Input execution parameters.

Definition at line 215 of file Skeleton.h.

bool te::rp::Skeleton::m_isInitialized
protected

Tells if this instance is initialized.

Definition at line 217 of file Skeleton.h.


The documentation for this class was generated from the following file: