Sample Usage shows you what is possible with your calibration data and provides code, which you can adapt to your own purposes. Choose the action you are interested in and the example code will be inserted into your program.
You have the choice between:
When you are finished, check the position of the insert cursor and click Insert Code to insert the code into your HDevelop program.
In the example code, the image coordinates of the first two mark center points are transformed into world coordinates and this (3D) distance is calculated. First, the image coordinates of some points of interest lying in the reference plane are obtained. Here, simply the first two mark center points of the plate are chosen and a line is drawn between the two points for visualization. Then image coordinates are converted into world coordinates using HALCON operator image_points_to_world_plane. The Z coordinates will be 0 by definition because the measurement plane is the plane with the world coordinate Z=0 (on reference plane). The distance in world coordinates is determined using distance_pp.
To adapt this code to your application, you typically exchange the mark centers for “real” points of interest.
In the example code, the XLD contours are transformed into world coordinates and this (3D) distance is calculated. The points are visualized by a line. First an XLD in image coordinates, which relates to some interesting features in the image, is obtained. Here, we simply generate a contour connecting the mark center points of the plate by using the HALCON operator gen_contour_polygon_xld. Then a conversion into world coordinates is performed with HALCON operator contour_to_world_plane_xld. Using the operator get_contour_xld, mark center points are extracted in world coordinates.
To adapt this code to your application, you typically exchange the mark centers for “real” points of interest and adapt or remove the visualization.
For further information about pose estimation, please refer to the section "Pose Estimation of known 3D Objects With a Single Camera" in the Solution Guide III-C.
First, the position of mark centers on the calibration plate is determined. With known camera parameters, one image is enough to determine the new pose using the HALCON operator camera_calibration.
This sample code always determines the pose of the calibration plate. There is no further adaption possible.
First the desired width of the visible area in world coordinates in mm is chosen and converted to m. Then set_origin_pose adjusts the origin so the plate is roughly centered. The HALCON operator gen_image_to_world_plane_map generates the rectification map. Finally, images can be rectified using the rectification map by map_image.
To adapt this code to your application, you typically change the scale and origin of the new image coordinate system.