Package boofcv.gui.binary
Class VisualizeBinaryData
- java.lang.Object
-
- boofcv.gui.binary.VisualizeBinaryData
-
public class VisualizeBinaryData extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description VisualizeBinaryData()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]checkColors(int[] colors, int size)static voidrender(java.util.List<boofcv.alg.filter.binary.Contour> contours, int[] colors, java.awt.image.BufferedImage out)Renders only the external contours.static voidrender(java.util.List<boofcv.alg.filter.binary.Contour> contours, java.awt.Color internal, java.awt.Color external, double stroke, double scale, java.awt.Graphics2D g2)static java.awt.image.BufferedImagerender(java.util.List<boofcv.alg.filter.binary.Contour> contours, java.awt.Color color, java.awt.image.BufferedImage out)static voidrender(java.util.List<java.util.List<georegression.struct.point.Point2D_I32>> contours, boolean loops, java.awt.Color color, double stroke, double scale, java.awt.Graphics2D g2)static java.awt.image.BufferedImagerenderBinary(boofcv.struct.image.GrayU8 binaryImage, boolean invert, java.awt.image.BufferedImage out)Renders a binary image.static java.awt.image.BufferedImagerenderContours(java.util.List<boofcv.alg.feature.detect.edge.EdgeContour> edges, int[] colors, int width, int height, java.awt.image.BufferedImage out)static java.awt.image.BufferedImagerenderContours(java.util.List<boofcv.alg.filter.binary.Contour> contours, int[] colorExternal, int colorInternal, int width, int height, java.awt.image.BufferedImage out)Draws contours.static java.awt.image.BufferedImagerenderContours(java.util.List<boofcv.alg.filter.binary.Contour> contours, int colorExternal, int colorInternal, int width, int height, java.awt.image.BufferedImage out)Draws contours.static java.awt.image.BufferedImagerenderLabeled(boofcv.struct.image.GrayS32 labelImage, int[] colors, java.awt.image.BufferedImage out)static java.awt.image.BufferedImagerenderLabeled(boofcv.struct.image.GrayS32 labelImage, int numRegions, java.awt.image.BufferedImage out)Renders a labeled where each region is assigned a random color.static java.awt.image.BufferedImagerenderLabeledBG(boofcv.struct.image.GrayS32 labelImage, int numRegions, java.awt.image.BufferedImage out)Renders a labeled image where label=0 is assumed to be the background and is always set to black.
-
-
-
Method Detail
-
renderContours
public static java.awt.image.BufferedImage renderContours(java.util.List<boofcv.alg.feature.detect.edge.EdgeContour> edges, int[] colors, int width, int height, java.awt.image.BufferedImage out)
-
renderContours
public static java.awt.image.BufferedImage renderContours(java.util.List<boofcv.alg.filter.binary.Contour> contours, int colorExternal, int colorInternal, int width, int height, java.awt.image.BufferedImage out)Draws contours. Internal and external contours are different user specified colors.- Parameters:
contours- List of contourscolorExternal- RGB colorcolorInternal- RGB colorwidth- Image widthheight- Image heightout- (Optional) storage for output image- Returns:
- Rendered contours
-
renderContours
public static java.awt.image.BufferedImage renderContours(java.util.List<boofcv.alg.filter.binary.Contour> contours, int[] colorExternal, int colorInternal, int width, int height, java.awt.image.BufferedImage out)Draws contours. Internal and external contours are different user specified colors.- Parameters:
contours- List of contourscolorExternal- (Optional) Array of RGB colors for each external contourcolorInternal- RGB colorwidth- Image widthheight- Image heightout- (Optional) storage for output image- Returns:
- Rendered contours
-
render
public static void render(java.util.List<boofcv.alg.filter.binary.Contour> contours, int[] colors, java.awt.image.BufferedImage out)Renders only the external contours. Each contour is individually colored as specified by 'colors'- Parameters:
contours- List of contourscolors- List of RGB colors for each element in contours. If null then random colors will be used.out- (Optional) Storage for output
-
checkColors
public static int[] checkColors(int[] colors, int size)
-
render
public static java.awt.image.BufferedImage render(java.util.List<boofcv.alg.filter.binary.Contour> contours, java.awt.Color color, java.awt.image.BufferedImage out)
-
render
public static void render(java.util.List<java.util.List<georegression.struct.point.Point2D_I32>> contours, boolean loops, java.awt.Color color, double stroke, double scale, java.awt.Graphics2D g2)
-
render
public static void render(java.util.List<boofcv.alg.filter.binary.Contour> contours, java.awt.Color internal, java.awt.Color external, double stroke, double scale, java.awt.Graphics2D g2)
-
renderLabeled
public static java.awt.image.BufferedImage renderLabeled(boofcv.struct.image.GrayS32 labelImage, int[] colors, java.awt.image.BufferedImage out)
-
renderLabeledBG
public static java.awt.image.BufferedImage renderLabeledBG(boofcv.struct.image.GrayS32 labelImage, int numRegions, java.awt.image.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 0numRegions- 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 java.awt.image.BufferedImage renderLabeled(boofcv.struct.image.GrayS32 labelImage, int numRegions, java.awt.image.BufferedImage out)Renders a labeled where each region is assigned a random color.- Parameters:
labelImage- Labeled image with labels from 0 to numRegions-1numRegions- Number of labeled in the imageout- Output image. If null a new image is declared- Returns:
- Colorized labeled image
-
renderBinary
public static java.awt.image.BufferedImage renderBinary(boofcv.struct.image.GrayU8 binaryImage, boolean invert, java.awt.image.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 outputout- (Output) optional storage for output image- Returns:
- Output rendered binary image
-
-