java.lang.Object
test.de.iip_ecosphere.platform.kiServices.functions.images.ImageProcessingTests

public class ImageProcessingTests extends Object
Class to test the method of image processing.
Author:
Weber
  • Field Details

  • Constructor Details

    • ImageProcessingTests

      public ImageProcessingTests()
  • Method Details

    • main

      public static void main(String[] args)
      Method to test the imageprocessing tasks in isolation.
      Parameters:
      args - Args.
    • createB64ImageStringFromImage

      public static void createB64ImageStringFromImage(String path) throws IOException
      Utility method to create new test data from images, will be saved to the testimage folder.
      Parameters:
      path - Path to the image to use.
      Throws:
      IOException - If the process fails to find, load or write to a file.
    • testGrayscaling

      public static BufferedImage testGrayscaling(BufferedImage image)
      Testing the grayscaling of images, not much possible automated, just to make sure its not broken.
      Parameters:
      image - the image to be grayscaled.
      Returns:
      the inputimage in grayscale.
    • testThresholdingImage

      public static BufferedImage testThresholdingImage(BufferedImage image, int threshold)
      Testing turning an image into black and white, no real assertion possible thus testing if it breaks.
      Parameters:
      image - the image to be turned into black and white.
      threshold - the color value will be used to separate into black and white.
      Returns:
      the Image in black and white.
    • testRescalingOfImage

      public static BufferedImage testRescalingOfImage(BufferedImage image, int height, int width)
      Tests the rescaling function of the imageprocessing class. Only testing for exception as the result cannot be evalutated automaticaly.
      Parameters:
      image - the image to be resacled.
      height - the target height of the new image.
      width - the target width of the new image.
      Returns:
      the image with its new dimensions.