Table of Contents

Class CudaImage<TColor, TDepth>

Namespace
Emgu.CV.Cuda
Assembly
Emgu.CV.dll

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 Range

The row range. Use MCvSlice.WholeSeq for all rows.

colRange Range

The column range. Use MCvSlice.WholeSeq for all columns.

CudaImage(IInputArray)

Create a GPU image from a regular image

public CudaImage(IInputArray img)

Parameters

img IInputArray

The image to be converted to GPU image

CudaImage(Size)

Create a CudaImage of the specific size

public CudaImage(Size size)

Parameters

size Size

The size of the image

CudaImage(int, int)

Create a CudaImage of the specific size

public CudaImage(int rows, int cols)

Parameters

rows int

The number of rows (height)

cols int

The number of columns (width)

CudaImage(int, int, bool)

Create a CudaImage of the specific size

public CudaImage(int rows, int cols, bool continuous)

Parameters

rows int

The number of rows (height)

cols int

The number of columns (width)

continuous bool

Indicates if the data should be continuous

Methods

Clone(Stream)

Create a clone of this CudaImage

public CudaImage<TColor, TDepth> Clone(Stream stream)

Parameters

stream Stream

Use 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 int

The 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 int

The inclusive stating column to be extracted

end int

The 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 Rectangle

Zero-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 Size

The new size

interpolationType Inter

The interpolation type

stream Stream

Use 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 int

The 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 int

The inclusive stating row to be extracted

end int

The 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