The task of the following example is to read an image and count the number of connected regions it it.
read_image (Image, 'pcb') threshold (Image, Region, 0, 122) connection (Region, ConnectedRegions) count_obj (ConnectedRegions, Number)
To easily integrate this HDevelop code into an actual application, we encapsulate the machine vision part in a local procedure.
threshold (Image, Region, 0, 122) connection (Region, ConnectedRegions) count_obj (ConnectedRegions, Number)