类 ImageUtils


  • public class ImageUtils
    extends Object
    图像工具类
    • 构造器详细资料

      • ImageUtils

        public ImageUtils()
    • 方法详细资料

      • 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 -