Skip to content

read_matrixReadMatrixReadMatrixread_matrixT_read_matrix🔗

Short description🔗

read_matrixReadMatrixReadMatrixread_matrixT_read_matrix — Read a matrix from a file.

Signature🔗

read_matrix( filename.read FileName, out matrix MatrixID )void ReadMatrix( const HTuple& FileName, HTuple* MatrixID )static void HOperatorSet.ReadMatrix( HTuple fileName, out HTuple matrixID )def read_matrix( file_name: str ) -> HHandle

Herror T_read_matrix( 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)

public HMatrix( string fileName )

void HMatrix::ReadMatrix( const HString& FileName )

void HMatrix::ReadMatrix( const char* FileName )

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

void HMatrix.ReadMatrix( string fileName )

Description🔗

The operator read_matrixReadMatrix reads a matrix, which has been written to the file with write_matrixWriteMatrix, from the file FileNamefileNamefile_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 MatrixIDmatrixIDmatrix_id of this matrix. Access to the elements of the matrix is possible e.g., with the operator get_full_matrixGetFullMatrix.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters🔗

FileNamefileNamefile_name (input_control) filename.read → (string)HTuple (HString)HTuple (string)strHtuple (char*)

File name.

File extension: .mtx

MatrixIDmatrixIDmatrix_id (output_control) matrix → (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle.

Result🔗

If the file name is valid, the operator read_matrixReadMatrix returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible successors

get_full_matrixGetFullMatrix

Module🔗

Foundation