Halcon如何保存仿射变换矩阵
这里我们通过序列化来实现的,如下图,写到硬盘的HomMat2D_1内容和从硬盘里HomMat2D_2读出的内容一致,源代码在图片下方。
Halcon源代码:
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_rotate (HomMat2DIdentity, -0.3, 256, 256, HomMat2D_1)
serialize_hom_mat2d (HomMat2D_1, SerializedItemHandle)
open_file ('1.mat', 'output_binary', FileHandle)
fwrite_serialized_item (FileHandle, SerializedItemHandle)
close_file (FileHandle)
open_file ('1.mat', 'input_binary', FileHandle)
fread_serialized_item (FileHandle, SerializedItemHandle)
deserialize_hom_mat2d (SerializedItemHandle, HomMat2D_2)
close_file (FileHandle)
------------------------Halcon,Visionpro高清视频教程,点击下载视频--------------------------