C#保存halcon的HomMat2D变量
float[] managed = new float[9];
for (int i = 0; i < 9; i++)
{
managed[i] = 1.0f;
}
managed[8] = -2.467002E+07f;
managed[7] = -1.093179E-37f;
HTuple hv_HomMat2D = new HTuple(managed);
HOperatorSet.SerializeHomMat2d(hv_HomMat2D, out HTuple serializedItemHandle);
HOperatorSet.OpenFile("test.mat", "output_binary", out HTuple fileHandle);
HOperatorSet.FwriteSerializedItem(fileHandle, serializedItemHandle);
HOperatorSet.CloseFile(fileHandle);
serializedItemHandle.Dispose();
hv_HomMat2D.Dispose();
halcon读取
open_file('test.mat','input_binary', FileHandle)
fread_serialized_item(FileHandle, SerializedItemHandle)
deserialize_hom_mat2d(SerializedItemHandle, HomMat2D)
close_file(FileHandle)