HALCON Reference Manual 10.0.2
Table of Contents / Matrix / File ClassesClassesClasses | | | Operators

read_matrixread_matrixread_matrixReadMatrixReadMatrix (Operator)

Name

read_matrixread_matrixread_matrixReadMatrixReadMatrix — Read a matrix from a file.

Signature

read_matrix( : : FileName : MatrixID)

Herror read_matrix(const char* FileName, Hlong* MatrixID)

Herror T_read_matrix(const Htuple FileName, Htuple* MatrixID)

Herror read_matrix(const HTuple& FileName, Hlong* MatrixID)

void HMatrix::ReadMatrix(const HTuple& FileName)

void HOperatorSetX.ReadMatrix(
[in] VARIANT FileName, [out] VARIANT* MatrixID)

void HMatrixX.ReadMatrix([in] BSTR FileName)

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

public HMatrix(string fileName)

void HMatrix.ReadMatrix(string fileName)

Description

The operator read_matrixread_matrixread_matrixReadMatrixReadMatrix reads a matrix, which has been written to the file with write_matrixwrite_matrixwrite_matrixWriteMatrixWriteMatrix, from the file FileNameFileNameFileNameFileNamefileName. 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 MatrixMatrixMatrixMatrixmatrix. The operator returns the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixID of this matrix. Access to the elements of the matrix is possible e.g. with the operator get_full_matrixget_full_matrixget_full_matrixGetFullMatrixGetFullMatrix.

Parallelization

Parameters

FileNameFileNameFileNameFileNamefileName (input_control)  filename.read HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

File name.

File extension: .mtx

MatrixIDMatrixIDMatrixIDMatrixIDmatrixID (output_control)  matrix HMatrix, HTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Matrix handle.

Result

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

Possible Successors

get_full_matrixget_full_matrixget_full_matrixGetFullMatrixGetFullMatrix

Module

Foundation


Table of Contents / Matrix / File ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH