write_matrixT_write_matrixWriteMatrixWriteMatrixwrite_matrix (算子名称)

名称

write_matrixT_write_matrixWriteMatrixWriteMatrixwrite_matrix — Write a matrix to a file.

参数签名

write_matrix( : : MatrixID, FileFormat, FileName : )

Herror T_write_matrix(const Htuple MatrixID, const Htuple FileFormat, const Htuple FileName)

void WriteMatrix(const HTuple& MatrixID, const HTuple& FileFormat, const HTuple& FileName)

void HMatrix::WriteMatrix(const HString& FileFormat, const HString& FileName) const

void HMatrix::WriteMatrix(const char* FileFormat, const char* FileName) const

void HMatrix::WriteMatrix(const wchar_t* FileFormat, const wchar_t* FileName) const   ( Windows only)

static void HOperatorSet.WriteMatrix(HTuple matrixID, HTuple fileFormat, HTuple fileName)

void HMatrix.WriteMatrix(string fileFormat, string fileName)

def write_matrix(matrix_id: HHandle, file_format: str, file_name: str) -> None

描述

该算子 write_matrixwrite_matrixWriteMatrixWriteMatrixWriteMatrixwrite_matrix writes a matrix to the file FileNameFileNameFileNameFileNamefileNamefile_name. The matrix can be read with read_matrixread_matrixReadMatrixReadMatrixReadMatrixread_matrix. The default HALCON file extension for the matrix is 'mtx'. The format of the file can be selected via the parameter FileFormatFileFormatFileFormatFileFormatfileFormatfile_format. The following values are supported: 'binary'"binary""binary""binary""binary""binary" for a binary file format, and 'ascii'"ascii""ascii""ascii""ascii""ascii" for a ascii text format. In the text format each row of the file contains one row of the matrix. The columns are separated with white spaces. The advantage of using the binary file format instead of the ascii text format is a smaller size of the output file.

运行信息

参数表

MatrixIDMatrixIDMatrixIDMatrixIDmatrixIDmatrix_id (input_control)  matrix HMatrix, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Matrix handle of the input matrix.

FileFormatFileFormatFileFormatFileFormatfileFormatfile_format (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Format of the file.

Default: 'binary' "binary" "binary" "binary" "binary" "binary"

List of values: 'ascii'"ascii""ascii""ascii""ascii""ascii", 'binary'"binary""binary""binary""binary""binary"

FileNameFileNameFileNameFileNamefileNamefile_name (input_control)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File name.

File extension: .mtx

结果

If the file name is valid (write permission), 该算子 write_matrixwrite_matrixWriteMatrixWriteMatrixWriteMatrixwrite_matrix 返回值 2 ( H_MSG_TRUE) . If necessary an exception is raised.

可能的前置算子

create_matrixcreate_matrixCreateMatrixCreateMatrixCreateMatrixcreate_matrix

模块

Foundation