Class CormierSegmentation

    • Constructor Detail

      • CormierSegmentation

        public CormierSegmentation​(EdgeDetector edgeDetector,
                                   LineDetector lineDetector,
                                   int minSegmentLength,
                                   float signLineProbThreshold)
        Parameters:
        edgeDetector - Edge detector instance used for getting probabilities of locally significant edges.
        lineDetector - Line detector instance used for gettine probabilities of semantically significant lines.
        minSegmentLength - Minimum length of any side of each segment.
        signLineProbThreshold - Minimum probability that line is significant for it to be used for segmentation.
    • Method Detail

      • getEdgeDetector

        public EdgeDetector getEdgeDetector()
        Returns:
        Edge detector instance used for getting probabilities of locally significant edges.
      • setEdgeDetector

        public void setEdgeDetector​(EdgeDetector edgeDetector)
        Parameters:
        edgeDetector - Edge detector instance used for getting probabilities of locally significant edges.
      • getLineDetector

        public LineDetector getLineDetector()
        Returns:
        Line detector instance used for gettine probabilities of semantically significant lines.
      • setLineDetector

        public void setLineDetector​(LineDetector lineDetector)
        Parameters:
        lineDetector - Line detector instance used for gettine probabilities of semantically significant lines.
      • getMinSegmentLength

        public int getMinSegmentLength()
        Returns:
        Minimum length of any side of each segment.
      • setMinSegmentLength

        public void setMinSegmentLength​(int minSegmentLength)
        Parameters:
        minSegmentLength - Minimum length of any side of each segment.
      • getSignLineProbThreshold

        public float getSignLineProbThreshold()
        Returns:
        Minimum probability that line is significant for it to be used for segmentation.
      • setSignLineProbThreshold

        public void setSignLineProbThreshold​(float signLineProbThreshold)
        Parameters:
        signLineProbThreshold - Minimum probability that line is significant for it to be used for segmentation.
      • run

        public AreaTree run​(Page page)
                     throws IOException
        Parameters:
        page - Target page which will be segmented. Make sure it's possible to get a screenshot of it using Page.getPngImage().
        Returns:
        X-Y tree of rectangular, non-overlapping segments, where each node's children fully cover the parent segment's area, with root node covering the whole image and leaf nodes being the most granular segments.
        Throws:
        IOException - If failed to process the screenshot of the given page.
      • run

        public AreaTree run​(byte[] imageData,
                            org.eclipse.rdf4j.model.IRI iri)
                     throws IOException
        Parameters:
        imageData - Screenshot of the page which will be segmented.
        iri - IRI which will be assigned to the resulting AreaTree.
        Returns:
        X-Y tree of rectangular, non-overlapping segments, where each node's children fully cover the parent segment's area, with root node covering the whole image and leaf nodes being the most granular segments.
        Throws:
        IOException - If failed to process the provided image data.