下面示例的任务是读取一幅图像,并计算其中连接区域的数量。
read_image (Image, 'pcb') threshold (Image, Region, 0, 122) connection (Region, ConnectedRegions) count_obj (ConnectedRegions, Number)
为了方便地将 HDevelop 代码集成到实际应用程序中,我们将机器视觉部分封装在一个本地函数中。
threshold (Image, Region, 0, 122) connection (Region, ConnectedRegions) count_obj (ConnectedRegions, Number)