boofcv.gui.binary
Class VisualizeBinaryData
- java.lang.Object
-
- boofcv.gui.binary.VisualizeBinaryData
-
public class VisualizeBinaryData extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description VisualizeBinaryData()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static int[]checkColors(int[] colors, int size)static java.awt.image.BufferedImagerenderBinary(GrayU8 binaryImage, boolean invert, java.awt.image.BufferedImage out)Renders a binary image.static java.awt.image.BufferedImagerenderContours(java.util.List<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<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<EdgeContour> edges, int[] colors, int width, int height, java.awt.image.BufferedImage out)static voidrenderExternal(java.util.List<Contour> contours, boolean internal, boolean external, double scale, java.awt.Graphics2D g2)static java.awt.image.BufferedImagerenderExternal(java.util.List<Contour> contours, java.awt.Color color, java.awt.image.BufferedImage out)static voidrenderExternal(java.util.List<Contour> contours, int[] colors, java.awt.image.BufferedImage out)Renders only the external contours.static java.awt.image.BufferedImagerenderLabeled(GrayS32 labelImage, int[] colors, java.awt.image.BufferedImage out)static java.awt.image.BufferedImagerenderLabeled(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(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<EdgeContour> edges, int[] colors, int width, int height, java.awt.image.BufferedImage out)
-
renderContours
public static java.awt.image.BufferedImage renderContours(java.util.List<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<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
-
renderExternal
public static void renderExternal(java.util.List<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)
-
renderExternal
public static java.awt.image.BufferedImage renderExternal(java.util.List<Contour> contours, java.awt.Color color, java.awt.image.BufferedImage out)
-
renderExternal
public static void renderExternal(java.util.List<Contour> contours, boolean internal, boolean external, double scale, java.awt.Graphics2D g2)
-
renderLabeled
public static java.awt.image.BufferedImage renderLabeled(GrayS32 labelImage, int[] colors, java.awt.image.BufferedImage out)
-
renderLabeledBG
public static java.awt.image.BufferedImage renderLabeledBG(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(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(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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG