Class BinaryFast


  • public class BinaryFast
    extends Object
    Class BinaryFast is a representation of a binary image storing the foreground and background edge pixels in hash tables for efficiency.
    Author:
    Simon Horne., Andrea Antonello (www.hydrologis.com)
    • Constructor Detail

      • BinaryFast

        public BinaryFast​(int[][] data)
        Create a BinaryFast object based on a data matrix.

        Note that the matrix cycles over matrix[i][j], where i = columns and j = rows.

        Parameters:
        data - the data matrix already in FOREGROUND, BACKGROUND mode.
    • Method Detail

      • removePixel

        public void removePixel​(Point p)
        Removes a foreground pixel from the 2D array by setting its value to background.
        Parameters:
        p - The point to be removed.
      • addPixel

        public void addPixel​(Point p)
        Adds a foreground pixel to the 2D array by setting its value to foreground.
        Parameters:
        p - The point to be added.
      • convertToArray

        public int[] convertToArray()
        Converts the 2D array into a 1D array of pixel values.
        Returns:
        The 1D array of pixel values.
      • generatePixels

        public void generatePixels​(HashSet<Point> pix)
        Generates a new 2D array of pixels from a hash set of foreground pixels.
        Parameters:
        pix - The hash set of foreground pixels.
      • convertToPixels

        public void convertToPixels​(HashSet<Point> pix)
        Adds the pixels from a hash set to the 2D array of pixels.
        Parameters:
        pix - The hash set of foreground pixels to be added.
      • generateForegroundEdge

        public void generateForegroundEdge()
        Generates the foreground edge hash set from the 2D array of pixels.
      • generateBackgroundEdgeFromForegroundEdge

        public void generateBackgroundEdgeFromForegroundEdge()
        Generates the background edge hash set from the foreground edge hash set and the 2D array of pixels.
      • generateForegroundEdgeFromBackgroundEdge

        public void generateForegroundEdgeFromBackgroundEdge()
        Generates the foreground edge hash set from the background edge hash set and the 2D array of pixels.
      • getValues

        public int[] getValues()
        Returns the int [] values of the Binary Fast image
        Returns:
        int[] the greylevel array of the image
      • getForegroundEdgePixels

        public HashSet<Point> getForegroundEdgePixels()
      • getBackgroundEdgePixels

        public HashSet<Point> getBackgroundEdgePixels()
      • getPixels

        public int[][] getPixels()
      • getWidth

        public int getWidth()
      • getHeight

        public int getHeight()