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.