类 ImageUtils
- java.lang.Object
-
- cn.smartjavaai.ocr.utils.ImageUtils
-
public class ImageUtils extends Object
图像工具类
-
-
构造器概要
构造器 构造器 说明 ImageUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voiddrawImageRect(BufferedImage image, int x, int y, int width, int height)画检测框static voiddrawImageRect(BufferedImage image, ai.djl.ndarray.NDArray box)画检测框(有倾斜角)static voiddrawImageRectWithText(BufferedImage image, ai.djl.ndarray.NDArray box, String text)画检测框(有倾斜角)和文本static voiddrawImageText(BufferedImage image, String text, int x, int y)显示文字static voiddrawRect(org.opencv.core.Mat mat, DetectionResponse detectionResponse)画矩形static voidsaveBoundingBoxImage(ai.djl.modality.cv.Image img, ai.djl.modality.cv.output.DetectedObjects detection, String name, String path)保存图片,含检测框static voidsaveImage(ai.djl.modality.cv.Image img, String name, String path)保存DJL图片static voidsaveImage(BufferedImage img, String name, String path)保存BufferedImage图片
-
-
-
方法详细资料
-
saveImage
public static void saveImage(BufferedImage img, String name, String path)
保存BufferedImage图片- 参数:
img-name-path-
-
saveImage
public static void saveImage(ai.djl.modality.cv.Image img, String name, String path)保存DJL图片- 参数:
img-name-path-
-
saveBoundingBoxImage
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-- 抛出:
IOException
-
drawImageRect
public static void drawImageRect(BufferedImage image, ai.djl.ndarray.NDArray box)
画检测框(有倾斜角)- 参数:
image-box-
-
drawImageRectWithText
public static void drawImageRectWithText(BufferedImage image, ai.djl.ndarray.NDArray box, String text)
画检测框(有倾斜角)和文本- 参数:
image-box-text-
-
drawImageRect
public static void drawImageRect(BufferedImage image, int x, int y, int width, int height)
画检测框- 参数:
image-x-y-width-height-
-
drawImageText
public static void drawImageText(BufferedImage image, String text, int x, int y)
显示文字- 参数:
image-text-x-y-
-
drawRect
public static void drawRect(org.opencv.core.Mat mat, DetectionResponse detectionResponse)画矩形- 参数:
mat-box-
-
-