Class EdgeDetector

    • Constructor Detail

      • EdgeDetector

        public EdgeDetector​(int halfWindowWidth,
                            float standardDeviation,
                            float priorProbability,
                            int pyramidLevels)
        Parameters:
        halfWindowWidth - Range of the neighborhood (around the pixel) taken into account when applying kernel density estimation using a Gaussian kernel.
        standardDeviation - Standard deviation used when applying kernel density estimation using a Gaussian kernel.
        priorProbability - Prior probability that a given pixel is an edge.
        pyramidLevels - Number of levels for the Gaussian pyramid used for the multiscale edge detection. Set to 1 to effectively turn off the multiscale edge detection
      • EdgeDetector

        public EdgeDetector​(int halfWindowWidth,
                            float standardDeviation,
                            float priorProbability,
                            int pyramidLevels,
                            boolean ndPregenEnabled,
                            boolean parallelEnabled)
        Parameters:
        ndPregenEnabled - If the edgeProbabilities(Mat, Mat) optimization by pre-generating and storing the NormalDistribution instances will be enabled. Disabling this will reduce the memory requirements significantly, but also slows down the process.
        parallelEnabled - If the edgeProbabilities(Mat, Mat) parallelization will be enabled. Disabling this will cause significant slow down on multithreaded systems.
        See Also:
        EdgeDetector(int, float, float, int)
    • Method Detail

      • getHalfWindowWidth

        public int getHalfWindowWidth()
        Returns:
        Range of the neighborhood (around the pixel) taken into account when applying kernel density estimation using a Gaussian kernel.
      • setHalfWindowWidth

        public void setHalfWindowWidth​(int halfWindowWidth)
        Parameters:
        halfWindowWidth - Range of the neighborhood (around the pixel) taken into account when applying kernel density estimation using a Gaussian kernel.
      • getStandardDeviation

        public float getStandardDeviation()
        Returns:
        Standard deviation used when applying kernel density estimation using a Gaussian kernel.
      • setStandardDeviation

        public void setStandardDeviation​(float standardDeviation)
        Parameters:
        standardDeviation - Standard deviation used when applying kernerl density estimation using a Gaussian kernel.
      • getPriorProbability

        public float getPriorProbability()
        Returns:
        Prior probability that a given pixel is an edge.
      • setPriorProbability

        public void setPriorProbability​(float priorProbability)
        Parameters:
        priorProbability - Prior probability that a given pixel is an edge.
      • getPyramidLevels

        public int getPyramidLevels()
        Returns:
        Number of levels for the Gaussian pyramid used for the multiscale edge detection. Set to 1 to effectively turn off the multiscale edge detection
      • setPyramidLevels

        public void setPyramidLevels​(int pyramidLevels)
        Parameters:
        pyramidLevels - Number of levels for the Gaussian pyramid used for the multiscale edge detection. Set to 1 to effectively turn off the multiscale edge detection
      • getEdgeProbabilities

        public org.javatuples.Pair<double[][],​double[][]> getEdgeProbabilities​(byte[] imageData)
        Returns:
        Probabilities of a horizontal/vertical edge on each pixel in the given image.
      • getEdgeProbabilities

        public org.javatuples.Pair<double[][],​double[][]> getEdgeProbabilities​(org.opencv.core.Mat image)
        Returns:
        Probabilities of a horizontal/vertical edge on each pixel in the given image.
      • multiscaleSobel

        public org.javatuples.Pair<org.opencv.core.Mat,​org.opencv.core.Mat> multiscaleSobel​(org.opencv.core.Mat greyscaleImage)
        Returns:
        Horzontal and vertical edges for the given image, calculated using multiscale Imgproc.Sobel(Mat, Mat, int, int, int) edge detection with a Gaussian pyramid with getPyramidLevels() levels. Calling sobel(Mat) returns the same result as calling this method when getPyramidLevels() is equal to 1. The dimensions of both horizontal and vertical edges are the same as the original image.