STIRA
0.1
|
Morphological thinning: applies the following set of structure elements;. More...
#include <Thinning.h>
Public Member Functions | |
Thinning () | |
constructor | |
~Thinning () | |
destructor | |
ArrayGrid< T > * | RunThinning (ArrayGrid< T > *pGridIn, common::RectangularROI< int > rroi, T value) |
run method More... | |
ArrayGrid< T > * | RunPruning (ArrayGrid< T > *pGridIn, common::RectangularROI< int > rroi, T value) |
run method More... | |
Morphological thinning: applies the following set of structure elements;.
[ 0 0 0 ] [ 0 0 ] [ 1 ] [ 1 1 0 ] [ 1 1 1 ] [ 1 ]
http://homepages.inf.ed.ac.uk/rbf/HIPR2/thin.htm Structuring elements for skeletonization by morphological thinning. At each iteration, the image is first thinned by the left hand structuring element, and then by the right hand one, and then with the remaining six 90° rotations of the two elements. The process is repeated in cyclic fashion until none of the thinnings produces any further change. As usual, the origin of the structuring element is at the center.
Pruning end branches: only if we assume structure goes from border to border in image; otherwise all structure will be "eaten"
[ 1 0 0 ] [ 0 1 0 ] [ 0 0 1 ] [ 0 0 0 ] [ 0 1 0 ] [ 0 1 0 ] [ 0 1 0 ] [ 0 1 1 ] [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ]
[ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] [ 0 0 0 ] [ 0 1 0 ] [ 0 1 0 ] [ 0 1 0 ] [ 1 1 0 ] [ 0 0 1 ] [ 0 1 0 ] [ 1 0 0 ] [ 0 0 0 ]
if one of the structure elements fits, the central pixel is set to the value of the neighbouring 0. This process is repeated until nothing changes anymore
ArrayGrid< T > * stira::imageanalysis::Thinning< T >::RunPruning | ( | ArrayGrid< T > * | pGridIn, |
common::RectangularROI< int > | rroi, | ||
T | value | ||
) |
run method
pGridIn | input grid |
value | value that is considered "foreground" |
References stira::common::MathUtils::ClipValue(), stira::imagedata::ArrayGrid< T >::Clone(), stira::common::RectangularROI< T >::GetBottomRightCorner(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::common::RectangularROI< T >::GetTopLeftCorner(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::ArrayGrid< T >::GetWidth(), stira::imagedata::ArrayGrid< T >::SetValue(), stira::common::Point< T >::x, and stira::common::Point< T >::y.
ArrayGrid< T > * stira::imageanalysis::Thinning< T >::RunThinning | ( | ArrayGrid< T > * | pGridIn, |
common::RectangularROI< int > | rroi, | ||
T | value | ||
) |
run method
pGridIn | input grid |
value | value that is considered "foreground" |
References stira::common::MathUtils::ClipValue(), stira::imagedata::ArrayGrid< T >::Clone(), stira::common::RectangularROI< T >::GetBottomRightCorner(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::common::RectangularROI< T >::GetTopLeftCorner(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::ArrayGrid< T >::GetWidth(), stira::imagedata::ArrayGrid< T >::SetGridValues(), stira::imagedata::ArrayGrid< T >::SetValue(), stira::common::Point< T >::x, and stira::common::Point< T >::y.