Class ImageUtils


  • public class ImageUtils
    extends ImageUtils
    Utility methods for image processing.
    • Constructor Detail

      • ImageUtils

        public ImageUtils()
    • Method Detail

      • getImageAsFile

        public static File getImageAsFile​(String imageName)
        Parameters:
        imageName - the name of a test image (as used in the locator yaml files)
        Returns:
        a File representing the specified image
      • imageToBase64String

        public static byte[] imageToBase64String​(BufferedImage image)
        Parameters:
        image - a BufferedImage
        Returns:
        a Base64 encoded String representing the specified image
      • scaleImage

        public static BufferedImage scaleImage​(BufferedImage image,
                                               double scaleFactor)
        Parameters:
        image - the BufferedImage to scale
        scaleFactor - the scale factor (<1 will scale down, >1 will scale up, 1 = 100%)
        Returns:
        a BufferedImage which is a version of the original image scaled by the given factor
      • scaleImage

        public static org.opencv.core.Mat scaleImage​(org.opencv.core.Mat image,
                                                     double scaleFactor)
        Parameters:
        image - the Mat to scale
        scaleFactor - the scale factor (<1 will scale down, >1 will scale up, 1 = 100%)
        Returns:
        a Mat which is a version of the original image scaled by the given factor