public class ImageUtils extends Object
| 构造器和说明 |
|---|
ImageUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
drawImageRect(BufferedImage image,
int x,
int y,
int width,
int height)
画检测框
|
static void |
drawImageRect(BufferedImage image,
ai.djl.ndarray.NDArray box)
画检测框(有倾斜角)
|
static void |
drawImageRectWithText(BufferedImage image,
ai.djl.ndarray.NDArray box,
String text)
画检测框(有倾斜角)和文本
|
static void |
drawImageText(BufferedImage image,
String text,
int x,
int y)
显示文字
|
static void |
drawRect(org.opencv.core.Mat mat,
DetectionResponse detectionResponse)
画矩形
|
static void |
saveBoundingBoxImage(ai.djl.modality.cv.Image img,
ai.djl.modality.cv.output.DetectedObjects detection,
String name,
String path)
保存图片,含检测框
|
static void |
saveImage(BufferedImage img,
String name,
String path)
保存BufferedImage图片
|
static void |
saveImage(ai.djl.modality.cv.Image img,
String name,
String path)
保存DJL图片
|
public static void saveImage(BufferedImage img, String name, String path)
img - name - path - public static void saveImage(ai.djl.modality.cv.Image img,
String name,
String path)
img - name - path - public static void saveBoundingBoxImage(ai.djl.modality.cv.Image img,
ai.djl.modality.cv.output.DetectedObjects detection,
String name,
String path)
throws IOException
img - detection - name - path - IOExceptionpublic static void drawImageRect(BufferedImage image, ai.djl.ndarray.NDArray box)
image - box - public static void drawImageRectWithText(BufferedImage image, ai.djl.ndarray.NDArray box, String text)
image - box - text - public static void drawImageRect(BufferedImage image, int x, int y, int width, int height)
image - x - y - width - height - public static void drawImageText(BufferedImage image, String text, int x, int y)
image - text - x - y - public static void drawRect(org.opencv.core.Mat mat,
DetectionResponse detectionResponse)
mat - box - Copyright © 2025. All rights reserved.