类 ImageUtils


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

      • ImageUtils

        public ImageUtils()
    • 方法详细资料

      • isBGR3Byte

        public static boolean isBGR3Byte​(BufferedImage image)
        推断图像是否为BGR格式
        返回:
      • getMatrixBGR

        public static byte[] getMatrixBGR​(BufferedImage image)
        对图像解码返回BGR格式矩阵数据
        参数:
        image -
        返回:
      • bgrToBufferedImage

        public static BufferedImage bgrToBufferedImage​(byte[] data,
                                                       int width,
                                                       int height)
      • isImageValid

        public static boolean isImageValid​(BufferedImage image)
        检查图像是否有效
        参数:
        image -
        返回:
      • drawImageRect

        public static void drawImageRect​(BufferedImage image,
                                         int x,
                                         int y,
                                         int width,
                                         int height)
        画检测框
        参数:
        image -
        x -
        y -
        width -
        height -
      • drawImageRect

        public static void drawImageRect​(ai.djl.modality.cv.Image image,
                                         int x,
                                         int y,
                                         int width,
                                         int height)
        画检测框
        参数:
        image -
        x -
        y -
        width -
        height -
      • drawImageRect

        public static void drawImageRect​(ai.djl.modality.cv.Image image,
                                         DetectionResponse detectionResponse)
        画检测框
        参数:
        image -
        x -
        y -
        width -
        height -