Class LineDetector

    • Constructor Detail

      • LineDetector

        public LineDetector​(int maxLineLength,
                            float edgeProbabilityThreshold,
                            int monteCarloTrials)
        Parameters:
        maxLineLength - Maximum length of a segmentation line (in pixels) before the algorithm splits it in half and processes each half separately.
        edgeProbabilityThreshold - Minimum probability of an edge in each pixel (obtained from EdgeDetector.getEdgeProbabilities(Mat)) required in order to be considered significant.
        monteCarloTrials - Number of Monte Carlo trials for determining the probability that line is semantically significant.
    • Method Detail

      • getMaxLineLength

        public int getMaxLineLength()
        Returns:
        Maximum length of a segmentation line (in pixels) before the algorithm splits it in half and processes each half separately.
      • setMaxLineLength

        public void setMaxLineLength​(int maxLineLength)
        Parameters:
        maxLineLength - Maximum length of a segmentation line (in pixels) before the algorithm splits it in half and processes each half separately.
      • getEdgeProbabilityThreshold

        public float getEdgeProbabilityThreshold()
        Returns:
        Minimum probability of an edge in each pixel (obtained from EdgeDetector.getEdgeProbabilities(Mat)) required in order to be considered significant.
      • setEdgeProbabilityThreshold

        public void setEdgeProbabilityThreshold​(float edgeProbabilityThreshold)
        Parameters:
        edgeProbabilityThreshold - Minimum probability of an edge in each pixel (obtained from EdgeDetector.getEdgeProbabilities(Mat)) required in order to be considered significant.
      • getMonteCarloTrials

        public int getMonteCarloTrials()
        Returns:
        Number of Monte Carlo trials for determining the probability that line is semantically significant.
      • setMonteCarloTrials

        public void setMonteCarloTrials​(int monteCarloTrials)
        Parameters:
        monteCarloTrials - Number of Monte Carlo trials for determining the probability that line is semantically significant.
      • lineProbability

        public float lineProbability​(double[] edgeProbabilities)
        Parameters:
        edgeProbabilities - Edge probabilities obtained from EdgeDetector.getEdgeProbabilities(Mat) for each pixel in the line to be checked in original order (i.e. not sorted).
        Returns:
        Probability that the line made of pixels with given edge probabilities is semantically significant for segmentation.