read_polygon_xld_arc_inforead_polygon_xld_arc_infoReadPolygonXldArcInfoReadPolygonXldArcInforead_polygon_xld_arc_info (Operator)
Name
read_polygon_xld_arc_inforead_polygon_xld_arc_infoReadPolygonXldArcInfoReadPolygonXldArcInforead_polygon_xld_arc_info — Read XLD polygons from a file in ARC/INFO generate format.
Signature
def read_polygon_xld_arc_info(file_name: str) -> HObject
Description
read_polygon_xld_arc_inforead_polygon_xld_arc_infoReadPolygonXldArcInfoReadPolygonXldArcInfoReadPolygonXldArcInforead_polygon_xld_arc_info reads the lines stored in ARC/INFO
generate format in the file FileNameFileNameFileNameFileNamefileNamefile_name, and returns them as
XLD polygons in PolygonsPolygonsPolygonsPolygonspolygonspolygons. 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 polygons are in world
coordinates. They can be transformed to the image coordinate system
with the operator affine_trans_polygon_xldaffine_trans_polygon_xldAffineTransPolygonXldAffineTransPolygonXldAffineTransPolygonXldaffine_trans_polygon_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.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
PolygonsPolygonsPolygonsPolygonspolygonspolygons (output_object) xld_poly(-array) → objectHXLDPolyHObjectHXLDPolyHobject *
Read XLD polygons.
FileNameFileNameFileNameFileNamefileNamefile_name (input_control) filename.read → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Name of the ARC/INFO file.
Example (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_polygon_xld_arc_info (LinesWorld, 'lines.gen')
* Transform the line data to image coordinates
affine_trans_polygon_xld (LinesWorld, Lines, ImageTransformation)
Result
If the parameters are correct and the file could be read, the
operator read_polygon_xld_arc_inforead_polygon_xld_arc_infoReadPolygonXldArcInfoReadPolygonXldArcInfoReadPolygonXldArcInforead_polygon_xld_arc_info returns the value 2 (
H_MSG_TRUE)
.
Otherwise an exception is raised.
Possible Successors
hom_mat2d_inverthom_mat2d_invertHomMat2dInvertHomMat2dInvertHomMat2dInverthom_mat2d_invert,
affine_trans_polygon_xldaffine_trans_polygon_xldAffineTransPolygonXldAffineTransPolygonXldAffineTransPolygonXldaffine_trans_polygon_xld
See also
read_world_fileread_world_fileReadWorldFileReadWorldFileReadWorldFileread_world_file,
write_polygon_xld_arc_infowrite_polygon_xld_arc_infoWritePolygonXldArcInfoWritePolygonXldArcInfoWritePolygonXldArcInfowrite_polygon_xld_arc_info,
read_contour_xld_arc_inforead_contour_xld_arc_infoReadContourXldArcInfoReadContourXldArcInfoReadContourXldArcInforead_contour_xld_arc_info
Module
Foundation