Class HoughSpaceLines


  • public class HoughSpaceLines
    extends Object

    This class is used as a result for the houghspace

    Since:
    1.0
    Author:
    Andreas Pointner, Gerald Zwettler
    • Constructor Detail

      • HoughSpaceLines

        public HoughSpaceLines​(int width,
                               int height,
                               double maxRotation,
                               double minRotation,
                               double rotationSteps)
        Parameters:
        width - width of the source image
        height - height of the source image
        maxRotation - end getRotation of the lines
        minRotation - start getRotation of the lines
        rotationSteps - getRotation steps in degrees
    • Method Detail

      • setHoughSpaceValue

        public void setHoughSpaceValue​(int x,
                                       int y,
                                       int rotationIdx,
                                       double value)
        set a value into the hough space
        Parameters:
        x - x-coordinate
        y - y-coordinate
        rotationIdx - getRotation index
        value - value
      • getHoughSpaceValue

        public double getHoughSpaceValue​(int x,
                                         int y,
                                         int rotationIdx)
        get a value from the hough space
        Parameters:
        x - x-coordinate
        y - y-coordinate
        rotationIdx - getRotation index
        Returns:
        return value
      • getBestXYradInSector

        public double[] getBestXYradInSector​(int xMin,
                                             int xMax,
                                             int yMin,
                                             int yMax)
        get the best value in a specific sector
        Parameters:
        xMin - start search x-coordinate
        xMax - end search x-coordinate
        yMin - start search y-coordinate
        yMax - end search y-coordinate
        Returns:
        returns an array with [0] = x; [1] = y; [2] = getRotation
      • getXBestXYradInSector

        public double[] getXBestXYradInSector​(int best,
                                              int xMin,
                                              int xMax,
                                              int yMin,
                                              int yMax)
        get the x best value in a specific sector
        Parameters:
        best - which value should be found. e.g. 1 means best value. 2 means second best value. and so on
        xMin - start search x-coordinate
        xMax - end search x-coordinate
        yMin - start search y-coordinate
        yMax - end search y-coordinate
        Returns:
        returns an array with [0] = x; [1] = y; [2] = getRotation
      • getBestXYradInSectorForRotation

        public double[] getBestXYradInSectorForRotation​(int xMin,
                                                        int xMax,
                                                        int yMin,
                                                        int yMax,
                                                        double rotationMin,
                                                        double rotationMax)
        get the best value in a specific sector in a specific direction
        Parameters:
        xMin - start search x-coordinate
        xMax - end search x-coordinate
        yMin - start search y-coordinate
        yMax - end search y-coordinate
        rotationMin - getRotation in degrees where to start
        rotationMax - getRotation in degrees where to end
        Returns:
        returns an array with [0] = x; [1] = y; [2] = getRotation
      • getNumOfRotations

        public int getNumOfRotations()
        Returns:
        number of getRotation (maxRotation - minRotation) / rotationStep + 0.5
      • toImage

        public <T> ImageWrapper<T> toImage​(int expoScale,
                                           @NonNull
                                           @NonNull ImageFactory<T> provider)
        extracts the best value for each point and adds it to the java image
        Type Parameters:
        T - The result type of the image.
        Parameters:
        expoScale - the value how high the exponent should be for scaling
        provider - the provider to create the resulting image
        Returns:
        a java image representation of the hough space
      • toImage

        public <T> ImageWrapper<T> toImage​(@NonNull
                                           @NonNull ImageFactory<T> provider)
        extracts the best value for each point and adds it to the java image
        Type Parameters:
        T - The type of the resulting image
        Parameters:
        provider - The image provider used to create the result image.
        Returns:
        a java image representation of the hough space