Class CudaImage<TColor, TDepth>
An CudaImage is very similar to the Emgu.CV.Image except that it is being used for GPU processing
public class CudaImage<TColor, TDepth> : GpuMat<TDepth>, IEquatable<GpuMat>, IInputOutputArray, IInputArrayOfArrays, IOutputArrayOfArrays, IOutputArray, IInputArray, IDisposable where TColor : struct, IColor where TDepth : new()
Type Parameters
TColor
Color type of this image (either Gray, Bgr, Bgra, Hsv, Hls, Lab, Luv, Xyz, Ycc, Rgb or Rbga)
TDepth
Depth of this image (either Byte, SByte, Single, double, UInt16, Int16 or Int32)
- Inheritance
-
GpuMat<TDepth>CudaImage<TColor, TDepth>
- Implements
- Inherited Members
- Extension Methods
Constructors
CudaImage()
Create an empty CudaImage
public CudaImage()
CudaImage(CudaImage<TColor, TDepth>, Range, Range)
Create a CudaImage from the specific region of image
. The data is shared between the two CudaImage
public CudaImage(CudaImage<TColor, TDepth> image, Range rowRange, Range colRange)
Parameters
image
CudaImage<TColor, TDepth>The CudaImage where the region is extracted from
rowRange
RangeThe row range. Use MCvSlice.WholeSeq for all rows.
colRange
RangeThe column range. Use MCvSlice.WholeSeq for all columns.
CudaImage(IInputArray)
Create a GPU image from a regular image
public CudaImage(IInputArray img)
Parameters
img
IInputArrayThe image to be converted to GPU image
CudaImage(Size)
Create a CudaImage of the specific size
public CudaImage(Size size)
Parameters
size
SizeThe size of the image
CudaImage(int, int)
Create a CudaImage of the specific size
public CudaImage(int rows, int cols)
Parameters
CudaImage(int, int, bool)
Create a CudaImage of the specific size
public CudaImage(int rows, int cols, bool continuous)
Parameters
rows
intThe number of rows (height)
cols
intThe number of columns (width)
continuous
boolIndicates if the data should be continuous
Methods
Clone(Stream)
Create a clone of this CudaImage
public CudaImage<TColor, TDepth> Clone(Stream stream)
Parameters
stream
StreamUse a Stream to call the function asynchronously (non-blocking) or null to call the function synchronously (blocking).
Returns
- CudaImage<TColor, TDepth>
A clone of this CudaImage
Col(int)
Returns a CudaImage corresponding to the ith column of the CudaImage. The data is shared with the current Image.
public CudaImage<TColor, TDepth> Col(int i)
Parameters
i
intThe column to be extracted
Returns
- CudaImage<TColor, TDepth>
The ith column of the CudaImage
Remarks
The parent CudaImage should never be released before the returned CudaImage that represent the subregion
ColRange(int, int)
Returns a CudaImage corresponding to the [start
end
) columns of the CudaImage. The data is shared with the current Image.
public CudaImage<TColor, TDepth> ColRange(int start, int end)
Parameters
start
intThe inclusive stating column to be extracted
end
intThe exclusive ending column to be extracted
Returns
- CudaImage<TColor, TDepth>
The [
start
end
) columns of the CudaImage
Remarks
The parent CudaImage should never be released before the returned CudaImage that represent the subregion
ConvertFrom<TSrcColor, TSrcDepth>(CudaImage<TSrcColor, TSrcDepth>)
Convert the source image to the current image, if the size are different, the current image will be a resized version of the srcImage.
public void ConvertFrom<TSrcColor, TSrcDepth>(CudaImage<TSrcColor, TSrcDepth> srcImage) where TSrcColor : struct, IColor where TSrcDepth : new()
Parameters
srcImage
CudaImage<TSrcColor, TSrcDepth>The sourceImage
Type Parameters
TSrcColor
The color type of the source image
TSrcDepth
The color depth of the source image
Convert<TOtherColor, TOtherDepth>()
Convert the current CudaImage to the specific color and depth
public CudaImage<TOtherColor, TOtherDepth> Convert<TOtherColor, TOtherDepth>() where TOtherColor : struct, IColor where TOtherDepth : new()
Returns
- CudaImage<TOtherColor, TOtherDepth>
CudaImage of the specific color and depth
Type Parameters
TOtherColor
The type of color to be converted to
TOtherDepth
The type of pixel depth to be converted to
GetSubRect(Rectangle)
Returns a CudaImage corresponding to a specified rectangle of the current CudaImage. The data is shared with the current matrix. In other words, it allows the user to treat a rectangular part of input array as a stand-alone array.
public CudaImage<TColor, TDepth> GetSubRect(Rectangle region)
Parameters
region
RectangleZero-based coordinates of the rectangle of interest.
Returns
- CudaImage<TColor, TDepth>
A CudaImage that represent the region of the current CudaImage.
Remarks
The parent CudaImage should never be released before the returned CudaImage that represent the subregion
Resize(Size, Inter, Stream)
Resize the CudaImage. The calling GpuMat be GpuMat%lt;Byte>. If stream is specified, it has to be either 1 or 4 channels.
public CudaImage<TColor, TDepth> Resize(Size size, Inter interpolationType, Stream stream = null)
Parameters
size
SizeThe new size
interpolationType
InterThe interpolation type
stream
StreamUse a Stream to call the function asynchronously (non-blocking) or null to call the function synchronously (blocking).
Returns
- CudaImage<TColor, TDepth>
A CudaImage of the new size
Row(int)
Returns a CudaImage corresponding to the ith row of the CudaImage. The data is shared with the current Image.
public CudaImage<TColor, TDepth> Row(int i)
Parameters
i
intThe row to be extracted
Returns
- CudaImage<TColor, TDepth>
The ith row of the CudaImage
Remarks
The parent CudaImage should never be released before the returned CudaImage that represent the subregion
RowRange(int, int)
Returns a CudaImage corresponding to the [start
end
) rows of the CudaImage. The data is shared with the current Image.
public CudaImage<TColor, TDepth> RowRange(int start, int end)
Parameters
start
intThe inclusive stating row to be extracted
end
intThe exclusive ending row to be extracted
Returns
- CudaImage<TColor, TDepth>
The [
start
end
) rows of the CudaImage
Remarks
The parent CudaImage should never be released before the returned CudaImage that represent the subregion
ToImage()
Convert the current CudaImage to a regular Image.
public Image<TColor, TDepth> ToImage()
Returns
- Image<TColor, TDepth>
A regular image