Package inra.ijpb.morphology.directional
Class DirectionalFilter
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.directional.DirectionalFilter
- All Implemented Interfaces:
Algo
public class DirectionalFilter extends AlgoStub
Directional filtering of planar images.
Oriented structuring elements are considered, for example linear structuring elements. A collection of orientation is chosen, and the result of a filtering operation is performed for each orientation of the structuring element. The results are combined to create the resulting image.
- Author:
- David Legland
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DirectionalFilter.Operation
A pre-defined set of operations.static class
DirectionalFilter.Type
Specifies how to combine the different orientations: min or max. -
Constructor Summary
Constructors Constructor Description DirectionalFilter(DirectionalFilter.Type type, DirectionalFilter.Operation op, int lineLength, int nTheta)
Creates new instance of directional filter using line structuring elements.DirectionalFilter(DirectionalFilter.Type type, DirectionalFilter.Operation op, OrientedStrelFactory factory, int nTheta)
Creates new instance of directional filter for arbitrary structuring elements, by specifying the factory. -
Method Summary
Modifier and Type Method Description static ij.process.ImageProcessor
mean(ij.process.ImageProcessor image, Strel strel)
Computes the average value among the neighbors.static ij.process.ImageProcessor
median(ij.process.ImageProcessor image, Strel strel)
Computes the median value among the neighbors.ij.process.ImageProcessor
process(ij.process.ImageProcessor image)
Apply directional filter with current settings to the specified image.Methods inherited from class inra.ijpb.algo.AlgoStub
addAlgoListener, removeAlgoListener
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DirectionalFilter
public DirectionalFilter(DirectionalFilter.Type type, DirectionalFilter.Operation op, int lineLength, int nTheta)Creates new instance of directional filter using line structuring elements.- Parameters:
type
- the type of combination (min or max)op
- the operation to apply with each structuring elementlineLength
- the (approximated) length of each line structuring element (in pixels)nTheta
- the number of directions to consider
-
DirectionalFilter
public DirectionalFilter(DirectionalFilter.Type type, DirectionalFilter.Operation op, OrientedStrelFactory factory, int nTheta)Creates new instance of directional filter for arbitrary structuring elements, by specifying the factory.- Parameters:
type
- the type of combination (min or max)op
- the operation to apply with each structuring elementfactory
- the factory for creating structuring elements of various orientationsnTheta
- the number of directions to consider
-
-
Method Details
-
process
public ij.process.ImageProcessor process(ij.process.ImageProcessor image)Apply directional filter with current settings to the specified image.- Parameters:
image
- a grayscale image- Returns:
- the result of directional filter
-
mean
Computes the average value among the neighbors.- Parameters:
image
- input imagestrel
- structuring element- Returns:
- result image
-
median
Computes the median value among the neighbors.- Parameters:
image
- input imagestrel
- structuring element- Returns:
- result image
-