public class ComponentPool extends Object
| 构造器和说明 |
|---|
ComponentPool(BufferedImage image)
Construct a ComponentPool by connected component analysis
|
ComponentPool(byte[] pixels,
int width,
int height)
Construct a ComponentPool by connected component analysis
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cleanPageEdges(int width,
int height)
Remove all connected components that touch bound of the image(they are
likely to be noise)
|
int |
countConnectedComponent(int left,
int right,
int top,
int bottom)
Count number of components intersect with a given area
|
void |
filterNoise() |
void |
filterNoise(int width,
int height)
Filter out small components
|
int |
getAverageHeight()
Get average height of the connected components
|
int |
getAverageWidth()
Get average width of the connected components
|
BoundBox |
getBoundBox() |
ArrayList<ConnectedComponent> |
getComponents()
Get all the connected components
|
public ComponentPool(byte[] pixels,
int width,
int height)
pixels - the input imagewidth - the width of the imageheight - the height of the imagepublic ComponentPool(BufferedImage image)
image - the input imagepublic int countConnectedComponent(int left,
int right,
int top,
int bottom)
left - left boundright - right boundtop - upper boundbottom - lower boundpublic ArrayList<ConnectedComponent> getComponents()
public int getAverageHeight()
public int getAverageWidth()
public void filterNoise()
public void filterNoise(int width,
int height)
width - the width of the imageheight - the width of the imagepublic void cleanPageEdges(int width,
int height)
width - height - public BoundBox getBoundBox()
Copyright © 2019. All rights reserved.