read_polygon_xld_arc_inforead_polygon_xld_arc_infoReadPolygonXldArcInfoReadPolygonXldArcInfo (Operator)

Name

read_polygon_xld_arc_inforead_polygon_xld_arc_infoReadPolygonXldArcInfoReadPolygonXldArcInfo — Read XLD polygons from a file in ARC/INFO generate format.

Signature

read_polygon_xld_arc_info( : Polygons : FileName : )

Herror read_polygon_xld_arc_info(Hobject* Polygons, const char* FileName)

Herror T_read_polygon_xld_arc_info(Hobject* Polygons, const Htuple FileName)

void ReadPolygonXldArcInfo(HObject* Polygons, const HTuple& FileName)

void HXLDPoly::ReadPolygonXldArcInfo(const HString& FileName)

void HXLDPoly::ReadPolygonXldArcInfo(const char* FileName)

void HXLDPoly::ReadPolygonXldArcInfo(const wchar_t* FileName)   (Windows only)

static void HOperatorSet.ReadPolygonXldArcInfo(out HObject polygons, HTuple fileName)

void HXLDPoly.ReadPolygonXldArcInfo(string fileName)

Description

read_polygon_xld_arc_inforead_polygon_xld_arc_infoReadPolygonXldArcInfoReadPolygonXldArcInfoReadPolygonXldArcInfo reads the lines stored in ARC/INFO generate format in the file FileNameFileNameFileNameFileNamefileName, and returns them as XLD polygons in PolygonsPolygonsPolygonsPolygonspolygons. To find the file FileNameFileNameFileNameFileNamefileName, all directories contained in the HALCON system variable '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_imageReadImageReadImageReadImage). 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_xldAffineTransPolygonXldAffineTransPolygonXldAffineTransPolygonXld. The necessary transformation matrix can be generated by using read_world_fileread_world_fileReadWorldFileReadWorldFileReadWorldFile to read the transformation matrix from image to world coordinates, and inverting this matrix by calling hom_mat2d_inverthom_mat2d_invertHomMat2dInvertHomMat2dInvertHomMat2dInvert.

Execution Information

Parameters

PolygonsPolygonsPolygonsPolygonspolygons (output_object)  xld_poly(-array) objectHXLDPolyHXLDPolyHobject *

Read XLD polygons.

FileNameFileNameFileNameFileNamefileName (input_control)  filename.read HTupleHTupleHtuple (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_infoReadPolygonXldArcInfoReadPolygonXldArcInfoReadPolygonXldArcInfo returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Successors

hom_mat2d_inverthom_mat2d_invertHomMat2dInvertHomMat2dInvertHomMat2dInvert, affine_trans_polygon_xldaffine_trans_polygon_xldAffineTransPolygonXldAffineTransPolygonXldAffineTransPolygonXld

See also

read_world_fileread_world_fileReadWorldFileReadWorldFileReadWorldFile, write_polygon_xld_arc_infowrite_polygon_xld_arc_infoWritePolygonXldArcInfoWritePolygonXldArcInfoWritePolygonXldArcInfo, read_contour_xld_arc_inforead_contour_xld_arc_infoReadContourXldArcInfoReadContourXldArcInfoReadContourXldArcInfo

Module

Foundation