Class VisualBlockDetector


  • public class VisualBlockDetector
    extends Object
    Detects the visual blocks in the page.
    Author:
    Tomas Popela, burgetr
    • Constructor Detail

      • VisualBlockDetector

        public VisualBlockDetector​(VisualArea rootArea)
        Creates a detector for the given root visual area.
        Parameters:
        rootArea - the root visual area to create detector for.
      • VisualBlockDetector

        public VisualBlockDetector​(VisualArea rootArea,
                                   int sizeTresholdWidth,
                                   int sizeTresholdHeight)
        Creates a new detector with the specified thresholds.
        Parameters:
        rootArea - the root visual area to create detector for.
        sizeTresholdWidth - Element's width treshold
        sizeTresholdHeight - Element's height treshold
    • Method Detail

      • parse

        public void parse()
        Creates the VIPS block trees and identifies the visual blocks.
      • getVisualBlocks

        public List<VisualBlock> getVisualBlocks()
        Selects all the extracted blocks from the tree of blocks.
        Returns:
        a list of extracted blocks
      • getSizeTresholdWidth

        public int getSizeTresholdWidth()
        Returns:
        the _sizeTresholdWidth
      • setSizeTresholdWidth

        public void setSizeTresholdWidth​(int sizeTresholdWidth)
        Parameters:
        sizeTresholdWidth - the _sizeTresholdWidth to set
      • getSizeTresholdHeight

        public int getSizeTresholdHeight()
        Returns:
        the _sizeTresholdHeight
      • setSizeTresholdHeight

        public void setSizeTresholdHeight​(int sizeTresholdHeight)
        Parameters:
        sizeTresholdHeight - the _sizeTresholdHeight to set