类 ConnectedComponent

    • 字段详细资料

      • cordTop

        public int cordTop
      • cordLeft

        public int cordLeft
      • cordBottom

        public int cordBottom
      • cordRight

        public int cordRight
    • 构造器详细资料

      • ConnectedComponent

        public ConnectedComponent()
        Construct a empty ConnectedComponent
      • ConnectedComponent

        public ConnectedComponent​(BufferedImage image)
        Construct a empty ConnectedComponent
        参数:
        image - Binarized image
      • ConnectedComponent

        public ConnectedComponent​(BoundBox box)
        Construct a empty ConnectedComponent with given bounds
        参数:
        box -
      • ConnectedComponent

        public ConnectedComponent​(int cordLeft,
                                  int cordRight,
                                  int cordTop,
                                  int cordBottom)
        Construct a empty ConnectedComponent with given bounds
        参数:
        cordLeft - left bound
        cordRight - right bound
        cordTop - upper bound
        cordBottom - lower bound
      • ConnectedComponent

        public ConnectedComponent​(RunLength runlength)
        Construct a ConnectedComponent with a single RunLength
        参数:
        runlength - the RunLength
    • 方法详细资料

      • addRunLength

        public void addRunLength​(RunLength runlength)
        Add a RunLength
        参数:
        runlength - the RunLength to be added
      • addRunLengthToLast

        public 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
        参数:
        runlength - the RunLength to be added
      • getRunLengths

        public List<RunLength> getRunLengths()
        Get the runlengths in the component
        返回:
        the runlengths
      • combineWith

        public void combineWith​(ConnectedComponent c)
        Merge this component with c
        参数:
        c - the component to merge
      • combine

        public static ConnectedComponent combine​(List<ConnectedComponent> c)
        Form a ConnectedComponent by combining a list of ConnectedComponent
        参数:
        c - the ConnectedComponent to be combined
        返回:
        combination result
      • splitHorizontally

        public ConnectedComponent splitHorizontally​(int x)
        Split this component horizontally
        参数:
        x - the coordinate of the line to be used to split
        返回:
        the right one
      • splitVertically

        public ConnectedComponent splitVertically​(int y)
        Split this component vertically
        参数:
        y - the coordinate of the line to be used to split
        返回:
        the lower one
      • getTop

        public int getTop()
        Get the position of the top of the component in the image
        返回:
        the coordinate
      • getBottom

        public int getBottom()
        Get the position of the bottom of the component in the image
        返回:
        the coordinate
      • getLeft

        public int getLeft()
        Get the position of the left of the component in the image
        返回:
        the coordinate
      • getRight

        public int getRight()
        Get the position of the right of the component in the image
        返回:
        the coordinate
      • getWidth

        public int getWidth()
        Get the width
        返回:
        width
      • getHeight

        public int getHeight()
        Get the height
        返回:
        height
      • getHorizontalCrossing

        public byte[] getHorizontalCrossing()
        Compute horizontal crossing numbers
        返回:
        horizontal crossing numbers
      • getVerticalCrossing

        public byte[] getVerticalCrossing()
        Compute vertical crossing numbers
        返回:
        vertical crossing numbers
      • getMoment

        public double getMoment​(int p,
                                int q)
        Get the moment
        参数:
        p - the order of x
        q - the order of y
        返回:
        the moment
      • getCentralMoment

        public double getCentralMoment​(int p,
                                       int q)
        Get the standardized moment
        参数:
        p - the order of x
        q - the order of y
        返回:
        the moment
      • getCenterX

        public double getCenterX()
        Get the horizontal center
        返回:
        the horizontal center
      • getCenterY

        public double getCenterY()
        Get the vertical center
        返回:
        the vertical center
      • getDirection

        public double getDirection()
        Get the direction
        返回:
        direction
      • getDensity

        public double getDensity()
        Get the density
        返回:
        density
      • getWeight

        public int getWeight()
        Get the Weight
        返回:
        weight
      • getNumberOfHoles

        public int getNumberOfHoles()
        Get the number of holes
        返回:
        number of holes
      • toPixelArray

        public byte[][] toPixelArray()
        Get two dimension pixels array representation
        返回:
        pixels array
      • toPixelArray2

        public byte[] toPixelArray2()
        Get one dimension pixels array representation
        返回:
        pixels array
      • toString

        public String toString()
        Get String that show the shape
        覆盖:
        toString 在类中 Object
        返回:
        the string that show the shape
      • fix

        public void fix()