read_matrixT_read_matrixReadMatrixReadMatrixread_matrix (算子)

名称

read_matrixT_read_matrixReadMatrixReadMatrixread_matrix — 从文件中读取矩阵。

签名

read_matrix( : : FileName : MatrixID)

Herror T_read_matrix(const Htuple FileName, Htuple* MatrixID)

void ReadMatrix(const HTuple& FileName, HTuple* MatrixID)

void HMatrix::HMatrix(const HString& FileName)

void HMatrix::HMatrix(const char* FileName)

void HMatrix::HMatrix(const wchar_t* FileName)   ( Windows only)

void HMatrix::ReadMatrix(const HString& FileName)

void HMatrix::ReadMatrix(const char* FileName)

void HMatrix::ReadMatrix(const wchar_t* FileName)   ( Windows only)

static void HOperatorSet.ReadMatrix(HTuple fileName, out HTuple matrixID)

public HMatrix(string fileName)

void HMatrix.ReadMatrix(string fileName)

def read_matrix(file_name: str) -> HHandle

描述

算子 read_matrixread_matrixReadMatrixReadMatrixReadMatrixread_matrix reads a matrix, which has been written to the file with write_matrixwrite_matrixWriteMatrixWriteMatrixWriteMatrixwrite_matrix, from the file FileNameFileNameFileNameFileNamefileNamefile_name. The default HALCON file extension for the matrix is 'mtx'. The format of the file can be binary or ascii. Each row of the file contains one row of a matrix with a number of columns. The columns are separated with white spaces or tabs. Each row must have the same number of columns. Empty lines are ignored.

The reading results are stored in the matrix Matrix. The operator returns the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id of this matrix.可通过算子 get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix 等方式访问该矩阵的元素。

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

参数

FileNameFileNameFileNameFileNamefileNamefile_name (输入控制)  filename.read HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File name.

File extension: .mtx

MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (输出控制)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle.

结果

If the file name is valid, the operator read_matrixread_matrixReadMatrixReadMatrixReadMatrixread_matrix 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。

可能的后继

get_full_matrixget_full_matrixGetFullMatrixGetFullMatrixGetFullMatrixget_full_matrix

模块

基础