public class BasicShapeDescriptor extends Object implements ConnectedComponentProcessor, FeatureVectorProvider<DoubleFV>
Modifier and Type | Class and Description |
---|---|
static class |
BasicShapeDescriptor.BasicShapeDescriptorType
An enum of all the different basic shape descriptors.
|
Modifier and Type | Field and Description |
---|---|
double |
area
The area of the component
|
double |
chfit
The ratio of the area of the component to the area of its convex hull
|
double |
compactness
The compactness of the component.
|
double |
cornerEst
The estimated number of corners of the component
|
double |
cx
The x coordinate of the component centroid
|
double |
cy
The y coordinate of the component centroid
|
double |
direction
The primary orientation of the component
|
double |
elongatedness
The elongatedness of the component.
|
Constructor and Description |
---|
BasicShapeDescriptor() |
Modifier and Type | Method and Description |
---|---|
DoubleFV |
getFeatureVector()
Get the FeatureVector associated with this object.
|
double[] |
getFeatureVectorArray()
Get all the values of the descriptor as an array in the order area,
centroid_x, centroid_y, direction, elongatedness, compactness
convex_hull_fit, corner_count
|
void |
process(ConnectedComponent cc)
Perform an operation on the given
ConnectedComponent . |
public double area
PixelSet.calculateArea()
public double cx
PixelSet.calculateCentroid()
public double cy
PixelSet.calculateCentroid()
public double direction
PixelSet.calculateDirection()
public double elongatedness
public double compactness
public double chfit
public double cornerEst
public BasicShapeDescriptor()
public void process(ConnectedComponent cc)
ConnectedComponentProcessor
ConnectedComponent
.process
in interface ConnectedComponentProcessor
cc
- The ConnectedComponent
to process.public double[] getFeatureVectorArray()
public DoubleFV getFeatureVector()
FeatureVectorProvider
getFeatureVector
in interface FeatureVectorProvider<DoubleFV>