Package boofcv.gui.binary
Class VisualizeBinaryData
java.lang.Object
boofcv.gui.binary.VisualizeBinaryData
Operations for visualizing binary images and related data structures.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]checkColors(@org.jetbrains.annotations.Nullable int[] colors, int size) static voidrender(List<Contour> contours, int[] colors, BufferedImage out) Renders only the external contours.static voidrender(List<Contour> contours, @Nullable Color internal, @Nullable Color external, double stroke, double scale, Graphics2D g2) static BufferedImagerender(List<Contour> contours, Color color, BufferedImage out) static voidrender(List<List<Point2D_I32>> contours, boolean loops, Color color, double stroke, double scale, Graphics2D g2) static BufferedImagerenderBinary(GrayU8 binaryImage, boolean invert, @Nullable BufferedImage out) Renders a binary image.static BufferedImagerenderContours(List<EdgeContour> edges, @org.jetbrains.annotations.Nullable int[] colors, int width, int height, @Nullable BufferedImage out) static BufferedImagerenderContours(List<Contour> contours, @org.jetbrains.annotations.Nullable int[] colorExternal, int colorInternal, int width, int height, @Nullable BufferedImage out) Draws contours.static BufferedImagerenderContours(List<Contour> contours, int colorExternal, int colorInternal, int width, int height, @Nullable BufferedImage out) Draws contours.static BufferedImagerenderLabeled(GrayS32 labelImage, int[] colors, @Nullable BufferedImage out) static BufferedImagerenderLabeled(GrayS32 labelImage, int numRegions, @Nullable BufferedImage out) Renders a labeled where each region is assigned a random color.static BufferedImagerenderLabeledBG(GrayS32 labelImage, int numRegions, @Nullable BufferedImage out) Renders a labeled image where label=0 is assumed to be the background and is always set to black.
-
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 contourscolorExternal- RGB colorcolorInternal- RGB colorwidth- Image widthheight- Image heightout- (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 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
Renders only the external contours. Each contour is individually colored as specified by 'colors'- Parameters:
contours- (Input) List of contourscolors- (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
-
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 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 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-1numRegions- Number of labeled in the imageout- 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 outputout- (Output) optional storage for output image- Returns:
- Output rendered binary image
-