类 ComponentPool


  • public class ComponentPool
    extends Object
    A data structure that store connected components
    • 构造器详细资料

      • ComponentPool

        public ComponentPool​(byte[] pixels,
                             int width,
                             int height)
        Construct a ComponentPool by connected component analysis
        参数:
        pixels - the input image
        width - the width of the image
        height - the height of the image
      • ComponentPool

        public ComponentPool​(BufferedImage image)
        Construct a ComponentPool by connected component analysis
        参数:
        image - the input image
    • 方法详细资料

      • countConnectedComponent

        public int countConnectedComponent​(int left,
                                           int right,
                                           int top,
                                           int bottom)
        Count number of components intersect with a given area
        参数:
        left - left bound
        right - right bound
        top - upper bound
        bottom - lower bound
        返回:
        the number
      • getComponents

        public ArrayList<ConnectedComponent> getComponents()
        Get all the connected components
        返回:
        a set of connected components
      • getAverageHeight

        public int getAverageHeight()
        Get average height of the connected components
        返回:
        the average height
      • getAverageWidth

        public int getAverageWidth()
        Get average width of the connected components
        返回:
        the average width
      • filterNoise

        public void filterNoise()
      • filterNoise

        public void filterNoise​(int width,
                                int height)
        Filter out small components
        参数:
        width - the width of the image
        height - the width of the image
      • cleanPageEdges

        public void cleanPageEdges​(int width,
                                   int height)
        Remove all connected components that touch bound of the image(they are likely to be noise)
        参数:
        width -
        height -
      • getBoundBox

        public BoundBox getBoundBox()