read_contour_xld_arc_inforead_contour_xld_arc_infoReadContourXldArcInfoReadContourXldArcInforead_contour_xld_arc_info (算子)
名称
read_contour_xld_arc_inforead_contour_xld_arc_infoReadContourXldArcInfoReadContourXldArcInforead_contour_xld_arc_info — 将 XLD 轮廓读取到 ARC/INFO 生成格式的文件中。
签名
def read_contour_xld_arc_info(file_name: str) -> HObject
描述
read_contour_xld_arc_inforead_contour_xld_arc_infoReadContourXldArcInfoReadContourXldArcInfoReadContourXldArcInforead_contour_xld_arc_info reads the lines stored in ARC/INFO
generate format in the file FileNameFileNameFileNameFileNamefileNamefile_name, and returns them as
XLD contours in ContoursContoursContoursContourscontourscontours. To find the file
FileNameFileNameFileNameFileNamefileNamefile_name, all directories contained in the HALCON system
variable 'image_dir'"image_dir""image_dir""image_dir""image_dir""image_dir" (usually this is the content of the
environment variable HALCONIMAGES) are searched (see
read_imageread_imageReadImageReadImageReadImageread_image). The returned contours are in world
coordinates. They can be transformed to the image coordinate system
with the operator affine_trans_contour_xldaffine_trans_contour_xldAffineTransContourXldAffineTransContourXldAffineTransContourXldaffine_trans_contour_xld。The necessary
transformation matrix can be generated by using
read_world_fileread_world_fileReadWorldFileReadWorldFileReadWorldFileread_world_file to read the transformation matrix from image
to world coordinates, and inverting this matrix by calling
hom_mat2d_inverthom_mat2d_invertHomMat2dInvertHomMat2dInvertHomMat2dInverthom_mat2d_invert。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
ContoursContoursContoursContourscontourscontours (输出对象) xld_cont(-array) → objectHXLDContHObjectHXLDContHobject *
Read XLD contours.
FileNameFileNameFileNameFileNamefileNamefile_name (输入控制) filename.read → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Name of the ARC/INFO file.
示例(HDevelop)
* Read the transformation and invert it
read_world_file ('image.tfw', WorldTransformation)
hom_mat2d_invert (WorldTransformation, ImageTransformation)
* Read the image
read_image (Image, 'image.tif')
* Read the line data
read_contour_xld_arc_info (LinesWorld, 'lines.gen')
* Transform the line data to image coordinates
affine_trans_contour_xld (LinesWorld, Lines, ImageTransformation)
结果
If the parameters are correct and the file could be read, the
operator read_contour_xld_arc_inforead_contour_xld_arc_infoReadContourXldArcInfoReadContourXldArcInfoReadContourXldArcInforead_contour_xld_arc_info 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。
可能的后继
hom_mat2d_inverthom_mat2d_invertHomMat2dInvertHomMat2dInvertHomMat2dInverthom_mat2d_invert,
affine_trans_contour_xldaffine_trans_contour_xldAffineTransContourXldAffineTransContourXldAffineTransContourXldaffine_trans_contour_xld
另见
read_world_fileread_world_fileReadWorldFileReadWorldFileReadWorldFileread_world_file,
write_contour_xld_arc_infowrite_contour_xld_arc_infoWriteContourXldArcInfoWriteContourXldArcInfoWriteContourXldArcInfowrite_contour_xld_arc_info,
read_polygon_xld_arc_inforead_polygon_xld_arc_infoReadPolygonXldArcInfoReadPolygonXldArcInfoReadPolygonXldArcInforead_polygon_xld_arc_info
模块
基础