FilterIterator Class |
Namespace: Accord.Imaging.Filters
The FilterIterator type exposes the following members.
Name | Description | |
---|---|---|
FilterIterator(IFilter) |
Initializes a new instance of the FilterIterator class.
| |
FilterIterator(IFilter, Int32) |
Initializes a new instance of the FilterIterator class.
|
Name | Description | |
---|---|---|
BaseFilter |
Base filter.
| |
FormatTranslations |
Format translations dictionary.
| |
Iterations |
Iterations amount, [1, 255].
|
Name | Description | |
---|---|---|
Apply(Bitmap) |
Apply filter to an image.
| |
Apply(BitmapData) |
Apply filter to an image.
| |
Apply(UnmanagedImage) |
Apply filter to an image in unmanaged memory.
| |
Apply(UnmanagedImage, UnmanagedImage) |
Apply filter to an image in unmanaged memory.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
Filter iterator performs specified amount of filter's iterations. The filter take the specified base filter and applies it to source image specified amount of times.
Note |
---|
The filter itself does not have any restrictions to pixel format of source image. This is set by base filter. |
Note |
---|
The filter does image processing using only IFilter interface of the specified base filter. This means that this filter may not utilize all potential features of the base filter, like in-place processing (see IInPlaceFilter) and region based processing (see IInPlacePartialFilter). To utilize those features, it is required to do filter's iteration manually. |
Sample usage (morphological thinning):
// create filter sequence FiltersSequence filterSequence = new FiltersSequence( ); // add 8 thinning filters with different structuring elements filterSequence.Add( new HitAndMiss( new short [,] { { 0, 0, 0 }, { -1, 1, -1 }, { 1, 1, 1 } }, HitAndMiss.Modes.Thinning ) ); filterSequence.Add( new HitAndMiss( new short [,] { { -1, 0, 0 }, { 1, 1, 0 }, { -1, 1, -1 } }, HitAndMiss.Modes.Thinning ) ); filterSequence.Add( new HitAndMiss( new short [,] { { 1, -1, 0 }, { 1, 1, 0 }, { 1, -1, 0 } }, HitAndMiss.Modes.Thinning ) ); filterSequence.Add( new HitAndMiss( new short [,] { { -1, 1, -1 }, { 1, 1, 0 }, { -1, 0, 0 } }, HitAndMiss.Modes.Thinning ) ); filterSequence.Add( new HitAndMiss( new short [,] { { 1, 1, 1 }, { -1, 1, -1 }, { 0, 0, 0 } }, HitAndMiss.Modes.Thinning ) ); filterSequence.Add( new HitAndMiss( new short [,] { { -1, 1, -1 }, { 0, 1, 1 }, { 0, 0, -1 } }, HitAndMiss.Modes.Thinning ) ); filterSequence.Add( new HitAndMiss( new short [,] { { 0, -1, 1 }, { 0, 1, 1 }, { 0, -1, 1 } }, HitAndMiss.Modes.Thinning ) ); filterSequence.Add( new HitAndMiss( new short [,] { { 0, 0, -1 }, { 0, 1, 1 }, { -1, 1, -1 } }, HitAndMiss.Modes.Thinning ) ); // create filter iterator for 10 iterations FilterIterator filter = new FilterIterator( filterSequence, 10 ); // apply the filter Bitmap newImage = filter.Apply( image );
Initial image:
Result image: