public class LocalBinaryPatterns extends AbstractFeatureDescriptor
For each pixel a histogram of LBP is constructed from all pixels in the region
specified by setNeighborhoodSize(int). In this region the LBP is
calculated for every pixel. The LBP is calculated by comparing the pixel
intensities of the central pixel to N neighboring pixels (setNumPoints(int))
on a circle of radius r (setRadius(double)). Interpolation
is used to retrieve the intensity of neighboring pixels.
The first two features represent the x and y coordinates of the pixel, the
remaining features the histogram of local binary patterns
(see setNumberOfHistogramBins(int)).
In comparison to MeanIntensityLocalBinaryPatterns, this class computes
one histogram of each pixel and computes local binary patterns from neighbors
lying on a circle around the central pixel.
References:
MeanIntensityLocalBinaryPatternsDescriptor.Supports| Modifier and Type | Field and Description |
|---|---|
protected double |
m_angle |
protected ij.process.ImageProcessor |
m_ip |
protected double[] |
m_offsets |
pcsDOES_ALL| Constructor and Description |
|---|
LocalBinaryPatterns() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateOffsets()
Calculates relative offsets in x and y direction of neighors with
respect to central pixel.
|
protected int |
getBinaryPattern(int x,
int y) |
double |
getConstant() |
String |
getDescription()
Returns a short plain Text description about the Descriptor and the
semantics of the double array obtained from
FeatureDescriptor.getFeatures(). |
protected int |
getMaxBinaryPattern() |
int |
getNumberOfHistogramBins() |
int |
getNumPoints() |
double |
getRadius() |
protected double[] |
processPixel(int x,
int y) |
void |
run(ij.process.ImageProcessor ip)
Start processing of this algorithm on the given image processor.
|
void |
setConstant(double offset)
Constant added to the intensity of the central pixel when comparing it
to its neighbors.
|
protected void |
setImageProcessor(ij.process.ImageProcessor ip) |
void |
setNeighborhoodSize(int neighborhoodSize)
Set the size of the neighborhood that is considered to construct a histogram
of binary patterns for each pixel.
|
void |
setNumberOfHistogramBins(int numBins)
Set the number of bins of the LBP histogram of each pixel.
|
void |
setNumPoints(int numPoints)
Number of neighbors to consider.
|
void |
setProperties(LibProperties properties)
Injects the properties class that can be used to retrieve several
properties.
|
void |
setRadius(double radius)
Set the radius of the neighborhood to consider.
|
EnumSet<Descriptor.Supports> |
supports()
Determine the capabilities of this algorithm.
|
addData, addData, addData, addPropertyChangeListener, endProgress, firePropertyChange, getFeatures, getMask, inMask, setMask, startProgressprotected double m_angle
protected double[] m_offsets
protected ij.process.ImageProcessor m_ip
public String getDescription()
FeatureDescriptorFeatureDescriptor.getFeatures().
May return null if no description is implemented - even though this
should be avoided by any means.public EnumSet<Descriptor.Supports> supports()
Descriptorsupports in interface Descriptorsupports in class AbstractFeatureDescriptorpublic void setProperties(LibProperties properties) throws IOException
FeatureDescriptorsetProperties in interface FeatureDescriptorsetProperties in class AbstractFeatureDescriptorIOException - if something went wrongpublic void run(ij.process.ImageProcessor ip)
Descriptorprotected int getMaxBinaryPattern()
protected void setImageProcessor(ij.process.ImageProcessor ip)
protected void calculateOffsets()
protected double[] processPixel(int x,
int y)
protected int getBinaryPattern(int x,
int y)
public void setNumPoints(int numPoints)
All neighbors lie equally spaced on a circle determined by setRadius(double).
numPoints - public void setRadius(double radius)
radius - in pixelsIllegalArgumentException - if radius <= 0public void setNeighborhoodSize(int neighborhoodSize)
For instance, a neighborhood size of 1 considers the 8-neighborhood of each pixel, and a neighborhood size of 2 the 25-neighborhood. The neighborhood is always quadractic.
neighborhoodSize - positive numberpublic void setConstant(double offset)
public void setNumberOfHistogramBins(int numBins)
numBins - a positive numberpublic double getRadius()
public int getNumPoints()
public double getConstant()
public int getNumberOfHistogramBins()
Copyright © 2013. All Rights Reserved.