Class VisualizeBinaryData

java.lang.Object
boofcv.gui.binary.VisualizeBinaryData

public class VisualizeBinaryData
extends Object
Operations for visualizing binary images and related data structures.
  • Constructor Details

    • VisualizeBinaryData

      public VisualizeBinaryData()
  • Method Details

    • renderContours

      public static BufferedImage renderContours​(List<EdgeContour> edges, @Nullable @org.jetbrains.annotations.Nullable int[] colors, int width, int height, @Nullable @Nullable BufferedImage out)
    • renderContours

      public static BufferedImage renderContours​(List<Contour> contours, int colorExternal, int colorInternal, int width, int height, @Nullable @Nullable BufferedImage out)
      Draws contours. Internal and external contours are different user specified colors.
      Parameters:
      contours - List of contours
      colorExternal - RGB color
      colorInternal - RGB color
      width - Image width
      height - Image height
      out - (Optional) storage for output image
      Returns:
      Rendered contours
    • renderContours

      public static BufferedImage renderContours​(List<Contour> contours, @Nullable @org.jetbrains.annotations.Nullable int[] colorExternal, int colorInternal, int width, int height, @Nullable @Nullable BufferedImage out)
      Draws contours. Internal and external contours are different user specified colors.
      Parameters:
      contours - List of contours
      colorExternal - (Optional) Array of RGB colors for each external contour
      colorInternal - RGB color
      width - Image width
      height - Image height
      out - (Optional) storage for output image
      Returns:
      Rendered contours
    • render

      public static void render​(List<Contour> contours, int[] colors, BufferedImage out)
      Renders only the external contours. Each contour is individually colored as specified by 'colors'
      Parameters:
      contours - (Input) List of contours
      colors - (Input) List of RGB colors for each element in contours. If null then random colors will be used.
      out - (Output) Where the contours are rendered.
    • checkColors

      public static int[] checkColors​(@Nullable @org.jetbrains.annotations.Nullable int[] colors, int size)
    • render

      public static BufferedImage render​(List<Contour> contours, Color color, BufferedImage out)
    • render

      public static void render​(List<List<Point2D_I32>> contours, boolean loops, Color color, double stroke, double scale, Graphics2D g2)
    • render

      public static void render​(List<Contour> contours, @Nullable @Nullable Color internal, @Nullable @Nullable Color external, double stroke, double scale, Graphics2D g2)
    • renderLabeled

      public static BufferedImage renderLabeled​(GrayS32 labelImage, int[] colors, @Nullable @Nullable BufferedImage out)
    • renderLabeledBG

      public static BufferedImage renderLabeledBG​(GrayS32 labelImage, int numRegions, @Nullable @Nullable BufferedImage out)
      Renders a labeled image where label=0 is assumed to be the background and is always set to black. All other labels are assigned a random color.
      Parameters:
      labelImage - Labeled image with background having a value of 0
      numRegions - Number of labeled in the image, excluding the background.
      out - Output image. If null a new image is declared
      Returns:
      Colorized labeled image
    • renderLabeled

      public static BufferedImage renderLabeled​(GrayS32 labelImage, int numRegions, @Nullable @Nullable BufferedImage out)
      Renders a labeled where each region is assigned a random color.
      Parameters:
      labelImage - Labeled image with labels from 0 to numRegions-1
      numRegions - Number of labeled in the image
      out - Output image. If null a new image is declared
      Returns:
      Colorized labeled image
    • renderBinary

      public static BufferedImage renderBinary​(GrayU8 binaryImage, boolean invert, @Nullable @Nullable BufferedImage out)
      Renders a binary image. 0 = black and 1 = white.
      Parameters:
      binaryImage - (Input) Input binary image.
      invert - (Input) if true it will invert the image on output
      out - (Output) optional storage for output image
      Returns:
      Output rendered binary image