Class OpenCVImageWrapper

    • Method Detail

      • getWidth

        public int getWidth()
        Returns:
        The image width
      • getHeight

        public int getHeight()
        Returns:
        The image height
      • getChannels

        public int getChannels()
        Returns:
        The number of channels
      • close

        public void close()
        Calls the releases the allocated image. Do not use further methods after calling this function
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface ImageWrapper<org.opencv.core.Mat>
        Overrides:
        close in class AbstractImageWrapper<org.opencv.core.Mat>
      • getValue

        public double getValue​(int x,
                               int y,
                               int channel)
        Description copied from interface: ImageWrapper
        Returns the value for a specific pixel and channel
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        channel - the channel to select of a specific pixel
        Returns:
        the value for the pixel and channel
      • setValue

        public void setValue​(int x,
                             int y,
                             int channel,
                             double val)
        Description copied from interface: ImageWrapper
        Sets a value for a specific pixel and channel
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        channel - the channel to select of a specific pixel
        val - the value for the pixel and channel
      • equals

        public boolean equals​(Object obj)
        Description copied from class: AbstractImageWrapper
        Uses GenericImageCompareFunction to compare if the two image wrappers are equal. If the obj is not a imagewrapper then super.equals will be called.
        Overrides:
        equals in class AbstractImageWrapper<org.opencv.core.Mat>
        Parameters:
        obj - the object to compare with
        Returns:
        whether the images are equal or not.
      • hashCode

        public int hashCode()
        Generated Code
        Overrides:
        hashCode in class AbstractImageWrapper<org.opencv.core.Mat>
        Returns:
        hashCode for the object
      • getValues

        public double[] getValues​(int x,
                                  int y)
        Description copied from interface: ImageWrapper
        Returns all value for a given coordinate
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        Returns:
        all pixel values at the given position
      • setValues

        public void setValues​(int x,
                              int y,
                              double[] values)
        Description copied from interface: ImageWrapper
        Sets values for the given coordinate
        Parameters:
        x - the x-coordinate of the pixel
        y - the y-coordinate of the pixel
        values - values for the given coordinate
      • getSupportedType

        public Class<org.opencv.core.Mat> getSupportedType()
        Returns:
        the supported image type.