vigra - Basic Morphological Operations

[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

| Basic Morphological Operations |

## Functions
template<... >
void | discDilation (...)
| Apply dilation (maximum) filter with disc of given radius to image. More...
template<... >
void | discDilationWithMask (...)
| Apply dilation (maximum) filter with disc of given radius to image using a mask. More...
template<... >
void | discErosion (...)
| Apply erosion (minimum) filter with disc of given radius to image. More...
template<... >
void | discErosionWithMask (...)
| Apply erosion (minimum) filter with disc of given radius to image using a mask. More...
template<... >
void | discMedian (...)
| Apply median filter with disc of given radius to image. More...
template<... >
void | discMedianWithMask (...)
| Apply median filter with disc of given radius to image using a mask. More...
template<... >
void | discRankOrderFilter (...)
| Apply rank order filter with disc structuring function to the image. More...
template<... >
void | discRankOrderFilterWithMask (...)
| Apply rank order filter with disc structuring function to the image using a mask. More...

## Detailed Description

Perform erosion, dilation, and median with disc structuring functions

See also: Morphological operators for multi-dimensional arrays. Separable morphology with parabola structuring functions in arbitrary dimensions

## Function Documentation

void vigra::discRankOrderFilter | ( |  | ...) |  |

Apply rank order filter with disc structuring function to the image.

The pixel values of the source image must be in the range 0...255. Radius must be >= 0. Rank must be in the range 0.0 <= rank <= 1.0. The filter acts as a minimum filter if rank = 0.0, as a median if rank = 0.5, and as a maximum filter if rank = 1.0. Accessor are used to access the pixel data.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
discRankOrderFilter(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, T2, S2> dest,
int radius, float rank);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
discRankOrderFilter(SrcIterator upperleft1,
SrcIterator lowerright1, SrcAccessor sa,
DestIterator upperleft2, DestAccessor da,
int radius, float rank)
}

use argument objects in conjunction with Argument Object Factories :

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
discRankOrderFilter(triple<SrcIterator, SrcIterator, SrcAccessor> src,
pair<DestIterator, DestAccessor> dest,
int radius, float rank)
}

Usage:

#include <vigra/flatmorphology.hxx>
Namespace: vigra

MultiArray<2, unsigned char> src(w, h), dest(w, h);
// do median filtering (because rank=0.5) in a cricle with radius 10
discRankOrderFilter(src, dest, 10, 0.5);

show deprecated examples

vigra::CImage src, dest;
// do median filtering
vigra::discRankOrderFilter(srcImageRange(src), destImage(dest), 10, 0.5);

Required Interface:

SrcIterator src_upperleft;
DestIterator dest_upperleft;
int x, y;
unsigned char value;
SrcAccessor src_accessor;
DestAccessor dest_accessor;
// value_type of accessor must be convertible to unsigned char
value = src_accessor(src_upperleft, x, y);
dest_accessor.set(value, dest_upperleft, x, y);

Preconditions:

for all source pixels: 0 <= value <= 255
(rank >= 0.0) && (rank <= 1.0)
radius >= 0

void vigra::discErosion | ( |  | ...) |  |

Apply erosion (minimum) filter with disc of given radius to image.

This is an abbreviation for the rank order filter with rank = 0.0. See discRankOrderFilter() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
discErosion(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, T2, S2> dest,
int radius);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
discErosion(SrcIterator upperleft1,
SrcIterator lowerright1, SrcAccessor sa,
DestIterator upperleft2, DestAccessor da,
int radius)
}

use argument objects in conjunction with Argument Object Factories :

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
discErosion(triple<SrcIterator, SrcIterator, SrcAccessor> src,
pair<DestIterator, DestAccessor> dest,
int radius)
}

void vigra::discDilation | ( |  | ...) |  |

Apply dilation (maximum) filter with disc of given radius to image.

This is an abbreviation for the rank order filter with rank = 1.0. See discRankOrderFilter() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
discDilation(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, T2, S2> dest,
int radius);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
discDilation(SrcIterator upperleft1,
SrcIterator lowerright1, SrcAccessor sa,
DestIterator upperleft2, DestAccessor da,
int radius)
}

use argument objects in conjunction with Argument Object Factories :

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
discDilation(triple<SrcIterator, SrcIterator, SrcAccessor> src,
pair<DestIterator, DestAccessor> dest,
int radius)
}

void vigra::discMedian | ( |  | ...) |  |

Apply median filter with disc of given radius to image.

This is an abbreviation for the rank order filter with rank = 0.5. See discRankOrderFilter() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
discMedian(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, T2, S2> dest,
int radius);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
discMedian(SrcIterator upperleft1,
SrcIterator lowerright1, SrcAccessor sa,
DestIterator upperleft2, DestAccessor da,
int radius)
}

use argument objects in conjunction with Argument Object Factories :

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
discMedian(triple<SrcIterator, SrcIterator, SrcAccessor> src,
pair<DestIterator, DestAccessor> dest,
int radius)
}

void vigra::discRankOrderFilterWithMask | ( |  | ...) |  |

Apply rank order filter with disc structuring function to the image using a mask.

The pixel values of the source image must be in the range 0...255. Radius must be >= 0. Rank must be in the range 0.0 <= rank <= 1.0. The filter acts as a minimum filter if rank = 0.0, as a median if rank = 0.5, and as a maximum filter if rank = 1.0. Accessor are used to access the pixel data.

The mask is only applied to th input image, i.e. the function generates an output wherever the current disc contains at least one pixel with mask value 'true'. Source pixels with mask value 'false' are ignored during the calculation of the rank order.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
discRankOrderFilterWithMask(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, TM, SM> const & mask,
MultiArrayView<2, T2, S2> dest,
int radius, float rank);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor>
void
discRankOrderFilterWithMask(SrcIterator upperleft1,
SrcIterator lowerright1, SrcAccessor sa,
MaskIterator upperleftm, MaskAccessor mask,
DestIterator upperleft2, DestAccessor da,
int radius, float rank)
}

group arguments (use in conjunction with Argument Object Factories):

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor>
void
discRankOrderFilterWithMask(triple<SrcIterator, SrcIterator, SrcAccessor> src,
pair<MaskIterator, MaskAccessor> mask,
pair<DestIterator, DestAccessor> dest,
int radius, float rank)
}

Usage:

#include <vigra/flatmorphology.hxx>
Namespace: vigra

MultiArray<2, unsigned char> src(w, h), dest(w, h), mask(w, h);
...
// do median filtering (since rank=0.5) in a circle with radius 10
// but change only the pixels under the mask
discRankOrderFilterWithMask(src, mask, dest, 10, 0.5);

show deprecated examples

vigra::CImage src, dest, mask;
// do median filtering
vigra::discRankOrderFilterWithMask(srcImageRange(src),
maskImage(mask), destImage(dest), 10, 0.5);

Required Interface:

SrcIterator src_upperleft;
DestIterator dest_upperleft;
MaskIterator mask_upperleft;
int x, y;
unsigned char value;
SrcAccessor src_accessor;
DestAccessor dest_accessor;
MaskAccessor mask_accessor;
mask_accessor(mask_upperleft, x, y) // convertible to bool
// value_type of accessor must be convertible to unsigned char
value = src_accessor(src_upperleft, x, y);
dest_accessor.set(value, dest_upperleft, x, y);

Preconditions:

for all source pixels: 0 <= value <= 255
(rank >= 0.0) && (rank <= 1.0)
radius >= 0

void vigra::discErosionWithMask | ( |  | ...) |  |

Apply erosion (minimum) filter with disc of given radius to image using a mask.

This is an abbreviation for the masked rank order filter with rank = 0.0. See discRankOrderFilterWithMask() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
discErosionWithMask(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, TM, SM> const & mask,
MultiArrayView<2, T2, S2> dest,
int radius);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor>
void
discErosionWithMask(SrcIterator upperleft1,
SrcIterator lowerright1, SrcAccessor sa,
MaskIterator upperleftm, MaskAccessor mask,
DestIterator upperleft2, DestAccessor da,
int radius)
}

group arguments (use in conjunction with Argument Object Factories):

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor>
void
discErosionWithMask(triple<SrcIterator, SrcIterator, SrcAccessor> src,
pair<MaskIterator, MaskAccessor> mask,
pair<DestIterator, DestAccessor> dest,
int radius)
}

void vigra::discDilationWithMask | ( |  | ...) |  |

Apply dilation (maximum) filter with disc of given radius to image using a mask.

This is an abbreviation for the masked rank order filter with rank = 1.0. See discRankOrderFilterWithMask() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
discDilationWithMask(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, TM, SM> const & mask,
MultiArrayView<2, T2, S2> dest,
int radius);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor>
void
discDilationWithMask(SrcIterator upperleft1,
SrcIterator lowerright1, SrcAccessor sa,
MaskIterator upperleftm, MaskAccessor mask,
DestIterator upperleft2, DestAccessor da,
int radius)
}

group arguments (use in conjunction with Argument Object Factories):

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor>
void
discDilationWithMask(triple<SrcIterator, SrcIterator, SrcAccessor> src,
pair<MaskIterator, MaskAccessor> mask,
pair<DestIterator, DestAccessor> dest,
int radius)
}

void vigra::discMedianWithMask | ( |  | ...) |  |

Apply median filter with disc of given radius to image using a mask.

This is an abbreviation for the masked rank order filter with rank = 0.5. See discRankOrderFilterWithMask() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
discMedianWithMask(MultiArrayView<2, T1, S1> const & src,
MultiArrayView<2, TM, SM> const & mask,
MultiArrayView<2, T2, S2> dest,
int radius);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor>
void
discMedianWithMask(SrcIterator upperleft1,
SrcIterator lowerright1, SrcAccessor sa,
MaskIterator upperleftm, MaskAccessor mask,
DestIterator upperleft2, DestAccessor da,
int radius)
}

group arguments (use in conjunction with Argument Object Factories):

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor>
void
discMedianWithMask(triple<SrcIterator, SrcIterator, SrcAccessor> src,
pair<MaskIterator, MaskAccessor> mask,
pair<DestIterator, DestAccessor> dest,
int radius)
}

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.10.0 (Thu Jan 8 2015)