Package cz.vutbr.fit.layout.cormier.impl
Class EdgeDetector
- java.lang.Object
-
- cz.vutbr.fit.layout.cormier.impl.EdgeDetector
-
public class EdgeDetector extends Object
Detector for locally significant edges for theCormierSegmentation.
-
-
Constructor Summary
Constructors Constructor Description EdgeDetector(int halfWindowWidth, float standardDeviation, float priorProbability, int pyramidLevels)EdgeDetector(int halfWindowWidth, float standardDeviation, float priorProbability, int pyramidLevels, boolean ndPregenEnabled, boolean parallelEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.javatuples.Pair<double[][],double[][]>getEdgeProbabilities(byte[] imageData)org.javatuples.Pair<double[][],double[][]>getEdgeProbabilities(org.opencv.core.Mat image)intgetHalfWindowWidth()floatgetPriorProbability()intgetPyramidLevels()floatgetStandardDeviation()org.javatuples.Pair<org.opencv.core.Mat,org.opencv.core.Mat>multiscaleSobel(org.opencv.core.Mat greyscaleImage)voidsetHalfWindowWidth(int halfWindowWidth)voidsetPriorProbability(float priorProbability)voidsetPyramidLevels(int pyramidLevels)voidsetStandardDeviation(float standardDeviation)
-
-
-
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 theedgeProbabilities(Mat, Mat)optimization by pre-generating and storing theNormalDistributioninstances will be enabled. Disabling this will reduce the memory requirements significantly, but also slows down the process.parallelEnabled- If theedgeProbabilities(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 withgetPyramidLevels()levels. Callingsobel(Mat)returns the same result as calling this method whengetPyramidLevels()is equal to 1. The dimensions of both horizontal and vertical edges are the same as the original image.
-
-