Package cz.vutbr.fit.layout.cormier.impl
Class LineDetector
- java.lang.Object
-
- cz.vutbr.fit.layout.cormier.impl.LineDetector
-
public class LineDetector extends Object
Detector for semantically significant lines for theCormierSegmentation.
-
-
Constructor Summary
Constructors Constructor Description LineDetector(int maxLineLength, float edgeProbabilityThreshold, int monteCarloTrials)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetEdgeProbabilityThreshold()intgetMaxLineLength()intgetMonteCarloTrials()floatlineProbability(double[] edgeProbabilities)voidsetEdgeProbabilityThreshold(float edgeProbabilityThreshold)voidsetMaxLineLength(int maxLineLength)voidsetMonteCarloTrials(int monteCarloTrials)
-
-
-
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 fromEdgeDetector.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 fromEdgeDetector.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 fromEdgeDetector.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.
-
-