Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::binary::BinaryMorphology< T > Class Template Reference

#include <BinaryMorphology.h>

Inheritance diagram for prapi::binary::BinaryMorphology< T >:

prapi::ImageTransform< T, T > List of all members.

Detailed Description

template<class T = bool>
class prapi::binary::BinaryMorphology< T >

Binary morphology operations.

This class performs the basic dilation and erosion operations with different structuring elements. It also has implementations for some higher-level operations.

An example of usage:

 // Make a new ConvolutionMask
 Matrix<int> mask(2,3,
                  1,1,1,
                  1,1,1);
 ConvolutionMask<int> se(mask);

 // If the "operation" point of your structuring element differs
 // from the center point of the element, you have to set it.
 Point<int> point(0,0);
 set.setOrigin(point);

 BinaryMorphology<int> morph(se, BIN_OPEN);

 Matrix<int> result(morph.getTransformedImage(some_binary_matrix));
 


Public Methods

 BinaryMorphology (const ConvolutionMask< T > &structuringElement, MorphologyOperation op)
 Create a new binary morphology operator.

void setOperation (MorphologyOperation op)
 Set the type of operation.

MorphologyOperation getOperation () const
 Get the type of operation.

ConvolutionMask< T > getConvolutionMask () const
 Get the ConvolutionMask.

void setConvolutionMask (const ConvolutionMask< T > &mask)
 Set the ConvolutionMask.

util::Matrix< T > getTransformedImage (const util::Matrix< T > &image) throw (ImageTransformException&)
util::Matrix< T > erode (const util::Matrix< T > &image) throw (ImageTransformException&)
 Perform binary erosion using the current convolution mask as a structuring element.

util::Matrix< T > dilate (const util::Matrix< T > &image) throw (ImageTransformException&)
 Perform binary dilation using the current convolution mask as a structuring element.


Constructor & Destructor Documentation

template<class T = bool>
prapi::binary::BinaryMorphology< T >::BinaryMorphology const ConvolutionMask< T > &    structuringElement,
MorphologyOperation    op
[inline]
 

Create a new binary morphology operator.

Parameters:
structuringElement  the structuring element (binary mask) used for morphology operations.
op  the type of operation


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.