boofcv.examples.segmentation
Class ExampleSegmentColor
- java.lang.Object
-
- boofcv.examples.segmentation.ExampleSegmentColor
-
public class ExampleSegmentColor extends java.lang.ObjectExample which demonstrates how color can be used to segment an image. The color space is converted from RGB into HSV. HSV separates intensity from color and allows you to search for a specific color based on two values independent of lighting conditions. Other color spaces are supported, such as YUV, XYZ, and LAB.
-
-
Constructor Summary
Constructors Constructor and Description ExampleSegmentColor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidmain(java.lang.String[] args)static voidprintClickedColor(java.awt.image.BufferedImage image)Shows a color image and allows the user to select a pixel, convert it to HSV, print the HSV values, and calls the function below to display similar pixels.static voidshowSelectedColor(java.lang.String name, java.awt.image.BufferedImage image, float hue, float saturation)Selectively displays only pixels which have a similar hue and saturation values to what is provided.
-
-
-
Method Detail
-
printClickedColor
public static void printClickedColor(java.awt.image.BufferedImage image)
Shows a color image and allows the user to select a pixel, convert it to HSV, print the HSV values, and calls the function below to display similar pixels.
-
showSelectedColor
public static void showSelectedColor(java.lang.String name, java.awt.image.BufferedImage image, float hue, float saturation)Selectively displays only pixels which have a similar hue and saturation values to what is provided. This is intended to be a simple example of color based segmentation. Color based segmentation can be done in RGB color, but is more problematic due to it not being intensity invariant. More robust techniques can use Gaussian models instead of a uniform distribution, as is done below.
-
main
public static void main(java.lang.String[] args)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG