Class Image
java.lang.Object
io.github.jspinak.brobot.model.element.Image
Physical representation of an image in the Brobot GUI automation framework.
Image serves as the core container for visual data in Brobot, providing a unified interface for working with images across different formats and libraries. It acts as the bridge between Java's BufferedImage, OpenCV's Mat format, and SikuliX's image representation, enabling seamless interoperability.
Key features:
- Multi-format Support: Stores images as BufferedImage internally with conversions to Mat (BGR/HSV) and SikuliX formats
- Database Persistence: Serializable to byte arrays for storage
- Color Space Conversions: Built-in BGR and HSV representations for advanced color-based matching
- Flexible Construction: Can be created from files, BufferedImages, Mats, Patterns, or SikuliX images
Use cases in model-based automation:
- Storing screenshots captured during automation execution
- Holding pattern templates for visual matching
- Providing image data for color analysis and profiling
- Enabling image manipulation and processing operations
The Image class abstracts away the complexity of working with multiple image libraries, providing a consistent API that supports the framework's cross-platform and technology-agnostic approach to GUI automation.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionImage()
Image
(BufferedImage bufferedImage) Image
(BufferedImage bufferedImage, String name) Image
(org.bytedeco.opencv.opencv_core.Mat BGRmat) Image
(org.sikuli.script.Image image) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Image
org.bytedeco.opencv.opencv_core.Mat
Returns the BGR representation as a JavaCV Mat.org.bytedeco.opencv.opencv_core.Mat
Returns the HSV representation as a JavaCV Mat.getName()
int
h()
int
hashCode()
boolean
isEmpty()
void
setBufferedImage
(BufferedImage bufferedImage) void
org.sikuli.script.Image
sikuli()
toString()
int
w()
-
Constructor Details
-
Image
-
Image
-
Image
public Image(org.bytedeco.opencv.opencv_core.Mat BGRmat) -
Image
-
Image
-
Image
-
Image
public Image(org.sikuli.script.Image image) -
Image
public Image()
-
-
Method Details
-
getMatBGR
public org.bytedeco.opencv.opencv_core.Mat getMatBGR()Returns the BGR representation as a JavaCV Mat. If there is a conversion issue, an empty Mat is returned.- Returns:
- the image as a Mat.
-
getMatHSV
public org.bytedeco.opencv.opencv_core.Mat getMatHSV()Returns the HSV representation as a JavaCV Mat. If there is a conversion issue, an empty Mat is returned.- Returns:
- the image as a Mat.
-
isEmpty
public boolean isEmpty() -
sikuli
public org.sikuli.script.Image sikuli() -
setName
-
setBufferedImage
-
w
public int w() -
h
public int h() -
getEmptyImage
-
toString
-
equals
-
hashCode
public int hashCode() -
getName
-
getBufferedImage
-