public class ConvertToMat extends Object
Mat
class used by OpenCV.Modifier and Type | Method and Description |
---|---|
static org.opencv.core.Mat |
createEmptyMat(Extent extent,
int type)
Creates a
Mat which contains only zero-values. |
static org.opencv.core.Mat |
fromObject(ObjectMask object)
Convert a
ObjectMask to a Mat . |
static org.opencv.core.Mat |
fromStack(Stack stack)
Converts a
Stack to a Mat . |
static org.opencv.core.Mat |
fromVoxelBufferByte(VoxelBuffer<UnsignedByteBuffer> voxelBuffer,
Extent extent)
|
static org.opencv.core.Mat |
fromVoxelBufferFloat(VoxelBuffer<FloatBuffer> voxelBuffer,
Extent extent)
|
static org.opencv.core.Mat |
fromVoxelBufferShort(VoxelBuffer<UnsignedShortBuffer> voxelBuffer,
Extent extent)
|
static org.opencv.core.Mat |
fromVoxelsByte(Voxels<UnsignedByteBuffer> voxels)
|
static org.opencv.core.Mat |
fromVoxelsFloat(Voxels<FloatBuffer> voxels)
|
static org.opencv.core.Mat |
fromVoxelsShort(Voxels<UnsignedShortBuffer> voxels)
|
static org.opencv.core.Mat |
makeRGBStack(Stack stack,
boolean swapRedBlueChannels)
Derives a
Mat representing an RGB stack. |
public static org.opencv.core.Mat fromObject(ObjectMask object) throws CreateException
ObjectMask
to a Mat
.object
- the object to convert.Mat
containing the voxels in the mask of the ObjectMask
.CreateException
- if the object is 3D, which is unsupported.public static org.opencv.core.Mat fromStack(Stack stack) throws CreateException
Stack
to a Mat
.stack
- the stack to convert, which must have 1 or 3 channels (in which case, it is
presumed to be RGB).Mat
with identical voxels to Stack
. In the case of an
RGB image, the Mat
has BGR channel ordering.CreateException
- if the stack is 3D, or has an invalid number of channels.public static org.opencv.core.Mat fromVoxelsByte(Voxels<UnsignedByteBuffer> voxels)
voxels
- the voxels to convert.Mat
.public static org.opencv.core.Mat fromVoxelsShort(Voxels<UnsignedShortBuffer> voxels)
voxels
- the voxels to convert.Mat
.public static org.opencv.core.Mat fromVoxelsFloat(Voxels<FloatBuffer> voxels)
voxels
- the voxels to convert.Mat
.public static org.opencv.core.Mat fromVoxelBufferByte(VoxelBuffer<UnsignedByteBuffer> voxelBuffer, Extent extent)
voxelBuffer
- the voxel-buffer to convert.extent
- the size of the image the buffer represents (must have identical number of
voxels to voxelBuffer
.Mat
.public static org.opencv.core.Mat fromVoxelBufferShort(VoxelBuffer<UnsignedShortBuffer> voxelBuffer, Extent extent)
voxelBuffer
- the voxel-buffer to convert.extent
- the size of the image the buffer represents (must have identical number of
voxels to voxelBuffer
.Mat
.public static org.opencv.core.Mat fromVoxelBufferFloat(VoxelBuffer<FloatBuffer> voxelBuffer, Extent extent)
voxelBuffer
- the voxel-buffer to convert.extent
- the size of the image the buffer represents (must have identical number of
voxels to voxelBuffer
.Mat
.public static org.opencv.core.Mat makeRGBStack(Stack stack, boolean swapRedBlueChannels) throws CreateException
Mat
representing an RGB stack.stack
- a stack containing three channels.swapRedBlueChannels
- if true, the first channel and third channel in stack
are
swapped to make the Mat
to e.g. translate RGB to BGR (as expected by OpenCV).Mat
representation of stack
.CreateException
- if the stack does not have exactly three channels.public static org.opencv.core.Mat createEmptyMat(Extent extent, int type)
Mat
which contains only zero-values.extent
- the size of the Mat
to create.type
- a OpenCV type constant indicating the data-type of the voxels in Mat
.Mat
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.