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.