Convert image to Java image
To work with a MATLAB® image in the Java® environment, you must convert the image from its MATLAB representation into an instance of the Java image class, sun.awt.image.ToolkitImage
.
Java requires uint8
data to create an instance of the
Java image class, sun.awt.image.ToolkitImage
. If the input
image is of class double
or uint16
, then
im2java
makes an equivalent image of class
uint8
, rescaling or offsetting the data as necessary, and then
converts this uint8
representation to an instance of the Java image class. For more information, see 8-Bit and 16-Bit Images.
im2java2d
(Image Processing Toolbox)