Class ImageProcessing

java.lang.Object
org.episteme.natural.engineering.vision.ImageProcessing

public class ImageProcessing extends Object
Computer vision image processing utilities.

This class uses standard double[][] arrays for image representation (normalized 0.0-1.0) to maintain high performance for pixel-level operations, as opposed to high-precision Real objects which would incur significant memory and CPU overhead for large images.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double[][]
    Gaussian blur kernel (3x3, σ ≈ 0.85).
    static final double[][]
    Laplacian kernel (second derivative).
    static final double[][]
    Prewitt edge detection kernel.
    static final double[][]
     
    static final double[][]
    Sharpen kernel.
    static final double[][]
    Sobel edge detection kernel (3x3).
    static final double[][]
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[][]
    convolve(double[][] image, double[][] kernel)
    Apply convolution kernel to grayscale image.
    static double[][]
    createGaussianKernel(double sigma, int size)
    Creates Gaussian kernel.
    static double[][]
    dilate(double[][] image)
    Morphological dilation (3x3 structuring element).
    static double[][]
    erode(double[][] image)
    Morphological erosion (3x3 structuring element).
    static double[][]
    gaussianBlur(double[][] image, double sigma, int kernelSize)
    Gaussian blur with specified sigma.
    static double[][]
    gradientDirection(double[][] image)
    Gradient direction from Sobel operators.
    static double
    otsuThreshold(double[][] image)
    Otsu's threshold (automatic).
    static double[][]
    sobelEdgeDetection(double[][] image)
    Sobel edge detection: gradient magnitude.
    static double[][]
    threshold(double[][] image, double thresh)
    Threshold image (binary).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SOBEL_X

      public static final double[][] SOBEL_X
      Sobel edge detection kernel (3x3).
    • SOBEL_Y

      public static final double[][] SOBEL_Y
    • PREWITT_X

      public static final double[][] PREWITT_X
      Prewitt edge detection kernel.
    • PREWITT_Y

      public static final double[][] PREWITT_Y
    • LAPLACIAN

      public static final double[][] LAPLACIAN
      Laplacian kernel (second derivative).
    • GAUSSIAN_3x3

      public static final double[][] GAUSSIAN_3x3
      Gaussian blur kernel (3x3, σ ≈ 0.85).
    • SHARPEN

      public static final double[][] SHARPEN
      Sharpen kernel.
  • Method Details

    • convolve

      public static double[][] convolve(double[][] image, double[][] kernel)
      Apply convolution kernel to grayscale image.
      Parameters:
      image - 2D grayscale image [height][width] (values usually 0.0 to 1.0)
      kernel - Convolution kernel
      Returns:
      Filtered image
    • sobelEdgeDetection

      public static double[][] sobelEdgeDetection(double[][] image)
      Sobel edge detection: gradient magnitude.
    • gradientDirection

      public static double[][] gradientDirection(double[][] image)
      Gradient direction from Sobel operators.
    • gaussianBlur

      public static double[][] gaussianBlur(double[][] image, double sigma, int kernelSize)
      Gaussian blur with specified sigma.
    • createGaussianKernel

      public static double[][] createGaussianKernel(double sigma, int size)
      Creates Gaussian kernel.
    • threshold

      public static double[][] threshold(double[][] image, double thresh)
      Threshold image (binary).
    • otsuThreshold

      public static double otsuThreshold(double[][] image)
      Otsu's threshold (automatic).
    • erode

      public static double[][] erode(double[][] image)
      Morphological erosion (3x3 structuring element).
    • dilate

      public static double[][] dilate(double[][] image)
      Morphological dilation (3x3 structuring element).