Class OpenCVImageWrapper
- java.lang.Object
-
- science.aist.imaging.api.domain.wrapper.AbstractImageWrapper<org.opencv.core.Mat>
-
- science.aist.imaging.opencv.imageprocessing.wrapper.OpenCVImageWrapper
-
- All Implemented Interfaces:
Serializable
,AutoCloseable
,ImageWrapper<org.opencv.core.Mat>
public class OpenCVImageWrapper extends AbstractImageWrapper<org.opencv.core.Mat>
Implementation of the ImageWrapper Interface for opencv
- Since:
- 1.0
- Author:
- Christoph Praschl
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static OpenCVImageCompareFunction
compare
-
Fields inherited from class science.aist.imaging.api.domain.wrapper.AbstractImageWrapper
channelType, closed, image
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Calls the releases the allocated image.boolean
equals(Object obj)
UsesGenericImageCompareFunction
to compare if the two image wrappers are equal.int
getChannels()
int
getHeight()
Class<org.opencv.core.Mat>
getSupportedType()
double
getValue(int x, int y, int channel)
Returns the value for a specific pixel and channeldouble[]
getValues(int x, int y)
Returns all value for a given coordinateint
getWidth()
int
hashCode()
Generated Codevoid
setValue(int x, int y, int channel, double val)
Sets a value for a specific pixel and channelvoid
setValues(int x, int y, double[] values)
Sets values for the given coordinate-
Methods inherited from class science.aist.imaging.api.domain.wrapper.AbstractImageWrapper
freeAllocatedImageWrappers, getChannelType, getImage
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface science.aist.imaging.api.domain.wrapper.ImageWrapper
applyColumnFunction, applyFunction, applyFunction, applyFunction, applyFunction, copyTo, createCopy, createCopy, getValuesAsColor, setValues, supportsParallelAccess
-
-
-
-
Field Detail
-
compare
protected static final OpenCVImageCompareFunction compare
-
-
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 interfaceAutoCloseable
- Specified by:
close
in interfaceImageWrapper<org.opencv.core.Mat>
- Overrides:
close
in classAbstractImageWrapper<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 pixely
- the y-coordinate of the pixelchannel
- 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 pixely
- the y-coordinate of the pixelchannel
- the channel to select of a specific pixelval
- the value for the pixel and channel
-
equals
public boolean equals(Object obj)
Description copied from class:AbstractImageWrapper
UsesGenericImageCompareFunction
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 classAbstractImageWrapper<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 classAbstractImageWrapper<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 pixely
- 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 pixely
- the y-coordinate of the pixelvalues
- values for the given coordinate
-
getSupportedType
public Class<org.opencv.core.Mat> getSupportedType()
- Returns:
- the supported image type.
-
-