public interface Image
Image is a container of an image in DJL. The storage type of the image depends on the
platform you are running on.| Modifier and Type | Interface and Description |
|---|---|
static class |
Image.Flag
Flag indicates the color channel options for images.
|
static class |
Image.Interpolation
Interpolation indicates the Interpolation options for resizinig an image.
|
static class |
Image.Type
Type indicates the type options for images.
|
| Modifier and Type | Method and Description |
|---|---|
void |
drawBoundingBoxes(DetectedObjects detections)
Draws the bounding boxes on the image.
|
void |
drawJoints(Joints joints)
Draws all joints of a body on an image.
|
Image |
duplicate(Image.Type type)
Gets a deep copy of the original image given the type.
|
int |
getHeight()
Gets the height of the image.
|
Image |
getSubimage(int x,
int y,
int w,
int h)
Gets the subimage defined by a specified rectangular region.
|
int |
getWidth()
Gets the width of the image.
|
java.lang.Object |
getWrappedImage()
Gets the wrapped image.
|
void |
save(java.io.OutputStream os,
java.lang.String type)
Save the image to file.
|
default NDArray |
toNDArray(NDManager manager)
Converts image to a RGB
NDArray. |
NDArray |
toNDArray(NDManager manager,
Image.Flag flag)
Converts image to a
NDArray. |
int getWidth()
int getHeight()
java.lang.Object getWrappedImage()
Image getSubimage(int x, int y, int w, int h)
x - the X coordinate of the upper-left corner of the specified rectangular regiony - the Y coordinate of the upper-left corner of the specified rectangular regionw - the width of the specified rectangular regionh - the height of the specified rectangular regionImage duplicate(Image.Type type)
type - the type of the copied imageNDArray toNDArray(NDManager manager, Image.Flag flag)
NDArray.void save(java.io.OutputStream os,
java.lang.String type)
throws java.io.IOException
os - OutputStream to save the image.type - type of the image, such as "png", "jpeg"java.io.IOException - image cannot be saved through output streamvoid drawBoundingBoxes(DetectedObjects detections)
detections - the object detection resultsvoid drawJoints(Joints joints)
joints - the joints of the body