Class MultiKernel

  • All Implemented Interfaces:
    Filter, Serializable

    public class MultiKernel
    extends Kernel
    Wrapper class to apply multiple kernels in a consecutive manner.

    Be aware that intermediary calculations are performed on an double precision and only the resulting value will be casted to the lesser precision type if applicable.

    Since:
    2.0.0
    Author:
    Kilian
    See Also:
    Serialized Form
    • Field Detail

      • kernels

        protected List<Kernel> kernels
        The kernels to apply back to back
    • Constructor Detail

      • MultiKernel

        public MultiKernel​(Kernel... kernels)
        Create a multi kernel from the given kernels
        Parameters:
        kernels - the kernels which will be chained
      • MultiKernel

        public MultiKernel​(double[][]... kernelMasks)
        Create a multi kernel with the given kernel maks. The kernels will use the default EdgeHandlingStrategy#EXPAND
        Parameters:
        kernelMasks - used to construct the kernels
    • Method Detail

      • apply

        public double[][] apply​(int[][] input)
        Description copied from class: Kernel
        Apply the kernel to the 2d array. If the desired output is a int[][] array refer to Kernel.applyInt(int[][]).
        Overrides:
        apply in class Kernel
        Parameters:
        input - the input array to apply the kernel on
        Returns:
        a new array created by the kernel
      • applyInt

        public int[][] applyInt​(int[][] input)
        Apply the kernel to the 2d array with each value casted to a int value.
        Overrides:
        applyInt in class Kernel
        Parameters:
        input - the input array to apply the kernel on
        Returns:
        a new array created by the kernel
      • apply

        public double[][] apply​(double[][] input)
        Apply the kernel to the 2d array.
        Overrides:
        apply in class Kernel
        Parameters:
        input - the input array to apply the kernel on
        Returns:
        a new array created by the kernel
      • apply

        public double[][] apply​(byte[][] input)
        Apply the kernel to the 2d array. If the desired output is a byte[][] array refer to applyByte(byte[][]).
        Overrides:
        apply in class Kernel
        Parameters:
        input - the input array to apply the kernel on
        Returns:
        a new array created by the kernel
      • applyByte

        public byte[][] applyByte​(byte[][] input)
        Apply the kernel to the 2d array with each value casted to a byte value.
        Overrides:
        applyByte in class Kernel
        Parameters:
        input - the input array to apply the kernel on
        Returns:
        a new array created by the kernel