CVMat - matt-s-clark/godot-gdextension-opencv GitHub Wiki

This class wraps the cv::mat, the main class OpenCV uses to represent images and data. More information here.

channels

Prototype: int channels()

Returns the number of channels (colors) in the mat.

col

Prototype: CVMat col(int x)

This method returns a reference for the specified matrix column and returns it. This is an O(1) operation, regardless of the matrix size. The underlying data of the new matrix is shared with the original matrix.

cols

Prototype: int cols

Read only property, number of columns in the mat.

convert_to

Prototype: void convert_to(int rtype)

Converts the type used to represent the elements in the mat.

copy

Prototype: CVMat copy()

Returns a copy of the specified matrix.

depth

Prototype: int depth()

Returns the identifier of the matrix element depth (the type of each individual channel). For example, for a 16-bit signed element array, the method returns the integer value of the CV_16S constant.

get_at

Prototype: Variant get_at(int row, int col)

Returns the value at a specific point in a two dimensional matrix, similar to at() in the c++ reference.

get_image

Prototype: Image get_image()

This is a helper method to convert a CVMat to a Godot.Image.

get_texture

Prototype: Texture get_texture()

This is a helper method to convert a CVMat to a Godot.Texture.

multiply

Prototype: void multiply(Variant value)

Modifies the mat by multiplying it by an integer or float, it's equivalent to mat *= value. Remember to observe the current type of the mat since the result will be cast to this type.

row

Prototype: CVMat row(int y)

This method returns a reference for the specified matrix row and returns it. This is an O(1) operation, regardless of the matrix size. The underlying data of the new matrix is shared with the original matrix.

rows

Prototype: int rows

Read only property, number of rows in the mat.

set_at

Prototype: void set_at(int row, int col, Variant value)

Sets the value at a specific point in a two dimensional matrix, similar to at() in the c++ reference.

set_image

Prototype: void set_image(Image image)

Helper method to set the mat data from an Godot.Image.

set_texture

Prototype: void set_texture(Texture2D texture)

Helper method to set the mat data from an Godot.Texture2D.

type

Prototype: int type()

Returns an integer representing the current type of the mat, see CVConsts.MatType.

eye

Prototype: static CVMat eye(int rows, int cols, int type)

Returns an identity matrix of the specified size and type.

from_image

Prototype: static CVMat from_image(Image image)

Helper method to create a mat from an Godot.Image data.

from_texture

Prototype: static CVMat from_texture(Texture2D texture)

Helper method to create a mat from an Godot.Texture2D data.

ones

Prototype: static CVMat ones(int rows, int cols, int type)

Returns an array of all 1's of the specified size and type.

zeros

Prototype: static CVMat zeros(int rows, int cols, int type)

Returns an array of all 0's of the specified size and type.