DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::ReducedMedialAxis< TPowerMap, TImageContainer > Struct Template Reference

Aim: Implementation of the separable medial axis extraction. More...

#include <DGtal/geometry/volumes/distance/ReducedMedialAxis.h>

Public Types

typedef Image< TImageContainerType
 

Static Public Member Functions

static Type getReducedMedialAxisFromPowerMap (const TPowerMap &aPowerMap)
 

Detailed Description

template<typename TPowerMap, typename TImageContainer = ImageContainerBySTLMap<typename TPowerMap::Domain, typename TPowerMap::PowerSeparableMetric::Value>>
struct DGtal::ReducedMedialAxis< TPowerMap, TImageContainer >

Aim: Implementation of the separable medial axis extraction.

Description of template class 'ReducedMedialAxis'

This utility struct extract medial axis balls from a PowerMap. Basically, each (weighted) site of the PowerMap defines a digital maximal ball if its digital power cell restricted to the input shape is not empty [27] .

   Optimal Separable Algorithms to Compute the Reverse
   Euclidean Distance Transformation and Discrete Medial Axis in
   Arbitrary Dimension, D. Coeurjolly and A. Montanvert, IEEE
   Transactions on Pattern Analysis and Machine Intelligence,
   29(3):437-448, 2007.

The output is an image associating ball radii (weight of the power map site) to maximal ball centers. Most methods output a lightweight proxy to an image container (of type ImageContainer, see below).

Note
Following ReverseDistanceTransformation, the input shape is defined as points with negative power distance.
Template Parameters
TPowerMapany specialized PowerMap type
TImageContainerany model of CImage to store the medial axis points (default: ImageContainerBySTLVector).
See also
testReducedMedialAxis.cpp

Definition at line 97 of file ReducedMedialAxis.h.

Member Typedef Documentation

◆ Type

template<typename TPowerMap , typename TImageContainer = ImageContainerBySTLMap<typename TPowerMap::Domain, typename TPowerMap::PowerSeparableMetric::Value>>
typedef Image<TImageContainer> DGtal::ReducedMedialAxis< TPowerMap, TImageContainer >::Type

Definition at line 100 of file ReducedMedialAxis.h.

Member Function Documentation

◆ getReducedMedialAxisFromPowerMap()

template<typename TPowerMap , typename TImageContainer = ImageContainerBySTLMap<typename TPowerMap::Domain, typename TPowerMap::PowerSeparableMetric::Value>>
static Type DGtal::ReducedMedialAxis< TPowerMap, TImageContainer >::getReducedMedialAxisFromPowerMap ( const TPowerMap & aPowerMap)
inlinestatic

Extract reduced medial axis from a power map. This methods is in \( O(|powerMap|)\).

Parameters
aPowerMapthe input powerMap
Returns
a lightweight proxy to the ImageContainer specified in template arguments.

Definition at line 112 of file ReducedMedialAxis.h.

113 {
114 TImageContainer *computedMA = new TImageContainer( aPowerMap.domain() );
115
116 for (typename TPowerMap::Domain::ConstIterator it = aPowerMap.domain().begin(),
117 itend = aPowerMap.domain().end(); it != itend; ++it)
118 {
119 const auto v = aPowerMap( *it );
120 const auto pv = aPowerMap.projectPoint( v );
121
122 if ( aPowerMap.metricPtr()->powerDistance( *it, v, aPowerMap.weightImagePtr()->operator()( pv ) )
124 computedMA->setValue( v, aPowerMap.weightImagePtr()->operator()( pv ) );
125 }
126
127 return Type( computedMA );
128 }
void setValue(const Point &aPoint, const Value &aValue)
Image< TImageContainer > Type
ImageContainerBySTLVector< HyperRectDomain< Z2i::Space >, std::unordered_set< Z2i::Point > > TImageContainer

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::setValue().


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