public class MomentFeature extends Object implements ComponentFeature
Constructor and Description |
---|
MomentFeature() |
Modifier and Type | Method and Description |
---|---|
void |
addSample(IntValuePixel p)
Add a pixel to this feature
|
MomentFeature |
clone()
Create a clone of this feature
|
FImage |
extractEllipsePatch(FImage image,
double sf)
Extract a rectangular image patch centered on the feature
with the same primary orientation and a given scale factor.
|
Circle |
getCircle(float sf)
Create an ellipse based on the features parameters.
|
Ellipse |
getEllipse()
Create an ellipse based on the features parameters
|
Ellipse |
getEllipse(float sf)
Create an ellipse based on the features parameters.
|
Polygon |
getEllipseBoundingBox(float sf)
Create a rotated rectangle that fits around an ellipse
based on the features parameters.
|
protected double[] |
getEllipseBoundingRectsData(double sf) |
double |
getOrientation()
Get the primary orientation of the feature.
|
double |
m01()
Get the value of m01
|
double |
m10()
Get the value of m10
|
void |
merge(ComponentFeature f)
Merge another feature with this one
|
double |
n()
Get the number of pixels accumulated
|
double |
u02()
Get the value of u02
|
double |
u11()
Get the value of u11
|
double |
u20()
Get the value of u20
|
public MomentFeature()
public void merge(ComponentFeature f)
ComponentFeature
merge
in interface ComponentFeature
f
- the feature to mergepublic void addSample(IntValuePixel p)
ComponentFeature
addSample
in interface ComponentFeature
p
- the pixel to addpublic double n()
public double u11()
public double u20()
public double u02()
public double m10()
public double m01()
public MomentFeature clone()
ComponentFeature
clone
in interface ComponentFeature
clone
in class Object
public Ellipse getEllipse()
public Ellipse getEllipse(float sf)
sf
- the scale factorpublic Circle getCircle(float sf)
sf
- the scale factorpublic Polygon getEllipseBoundingBox(float sf)
sf
- the scale factorpublic double getOrientation()
protected double[] getEllipseBoundingRectsData(double sf)
public FImage extractEllipsePatch(FImage image, double sf)
image
- the image to extract fromsf
- the scale factor