public final class ConnectedComponent extends Object implements Externalizable, Comparable<ConnectedComponent>
| 限定符和类型 | 字段和说明 |
|---|---|
int |
cordBottom |
int |
cordLeft |
int |
cordRight |
int |
cordTop |
static Comparator<ConnectedComponent> |
FROM_LEFT |
| 构造器和说明 |
|---|
ConnectedComponent()
Construct a empty ConnectedComponent
|
ConnectedComponent(BoundBox box)
Construct a empty ConnectedComponent with given bounds
|
ConnectedComponent(BufferedImage image)
Construct a empty ConnectedComponent
|
ConnectedComponent(int cordLeft,
int cordRight,
int cordTop,
int cordBottom)
Construct a empty ConnectedComponent with given bounds
|
ConnectedComponent(RunLength runlength)
Construct a ConnectedComponent with a single RunLength
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addRunLength(RunLength runlength)
Add a RunLength
|
void |
addRunLengthToLast(RunLength runlength)
Add a RunLength provided that it is greater than all the RunLength
already in the ConnectedComponent this method is added to enhance
performance of connected component analysis
|
static ConnectedComponent |
combine(List<ConnectedComponent> c)
Form a ConnectedComponent by combining a list of ConnectedComponent
|
void |
combineWith(ConnectedComponent c)
Merge this component with c
|
int |
compareTo(ConnectedComponent ele)
Compare first runlength of ConnectedComponent
|
void |
fix() |
int |
getBottom()
Get the position of the bottom of the component in the image
|
BoundBox |
getBox() |
double |
getCenterX()
Get the horizontal center
|
double |
getCenterY()
Get the vertical center
|
double |
getCentralMoment(int p,
int q)
Get the standardized moment
|
double |
getDensity()
Get the density
|
double |
getDirection()
Get the direction
|
int |
getHeight()
Get the height
|
byte[] |
getHorizontalCrossing()
Compute horizontal crossing numbers
|
int |
getLeft()
Get the position of the left of the component in the image
|
double |
getMoment(int p,
int q)
Get the moment
|
int |
getNumberOfHoles()
Get the number of holes
|
int |
getRight()
Get the position of the right of the component in the image
|
List<RunLength> |
getRunLengths()
Get the runlengths in the component
|
int |
getTop()
Get the position of the top of the component in the image
|
byte[] |
getVerticalCrossing()
Compute vertical crossing numbers
|
int |
getWeight()
Get the Weight
|
int |
getWidth()
Get the width
|
void |
readExternal(ObjectInput in)
Load ConnectedComponent from stream
|
ConnectedComponent |
splitHorizontally(int x)
Split this component horizontally
|
ConnectedComponent |
splitVertically(int y)
Split this component vertically
|
byte[][] |
toPixelArray()
Get two dimension pixels array representation
|
byte[] |
toPixelArray2()
Get one dimension pixels array representation
|
String |
toString()
Get String that show the shape
|
void |
writeExternal(ObjectOutput out)
Write this object to stream
|
public static final Comparator<ConnectedComponent> FROM_LEFT
public int cordTop
public int cordLeft
public int cordBottom
public int cordRight
public ConnectedComponent()
public ConnectedComponent(BufferedImage image)
image - Binarized imagepublic ConnectedComponent(BoundBox box)
box - public ConnectedComponent(int cordLeft,
int cordRight,
int cordTop,
int cordBottom)
cordLeft - left boundcordRight - right boundcordTop - upper boundcordBottom - lower boundpublic ConnectedComponent(RunLength runlength)
runlength - the RunLengthpublic void addRunLength(RunLength runlength)
runlength - the RunLength to be addedpublic void addRunLengthToLast(RunLength runlength)
runlength - the RunLength to be addedpublic List<RunLength> getRunLengths()
public void combineWith(ConnectedComponent c)
c - the component to mergepublic static ConnectedComponent combine(List<ConnectedComponent> c)
c - the ConnectedComponent to be combinedpublic ConnectedComponent splitHorizontally(int x)
x - the coordinate of the line to be used to splitpublic ConnectedComponent splitVertically(int y)
y - the coordinate of the line to be used to splitpublic int getTop()
public int getBottom()
public int getLeft()
public int getRight()
public int getWidth()
public int getHeight()
public byte[] getHorizontalCrossing()
public byte[] getVerticalCrossing()
public double getMoment(int p,
int q)
p - the order of xq - the order of ypublic double getCentralMoment(int p,
int q)
p - the order of xq - the order of ypublic double getCenterX()
public double getCenterY()
public double getDirection()
public double getDensity()
public int getWeight()
public int getNumberOfHoles()
public byte[][] toPixelArray()
public byte[] toPixelArray2()
public String toString()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal 在接口中 Externalizableout - output streamIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal 在接口中 Externalizablein - input streamIOExceptionpublic int compareTo(ConnectedComponent ele)
compareTo 在接口中 Comparable<ConnectedComponent>ele - to be compared topublic BoundBox getBox()
public void fix()
Copyright © 2019. All rights reserved.