-
This example program shows how fit_rectangle2_contour_xld can be used to
-
detect manufacturing errors of punched holes in a metal part. The errors
-
show up as small protrusions of the metal into the hole. They can be detected
-
by fitting rectangles to the edges of the hole robustly (i.e., with outlier
-
suppression) and the calculating the distances of the edges to the rectangle
-
sides using dist_rectangle2_contour_points_xld. Since the corners of the
-
holes are slightly rounded, some extra processing must be performed to
-
disregard the corners in the check for errors.
<
dev_update_off ()
read_image (Image, ‘punched_holes’)
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width, Height, ‘black’, WindowHandle)
set_display_font (WindowHandle, 16, ‘mono’, ‘true’, ‘false’)
dev_display (Image)
fit_rectangle2_contour_xld
该示例程序演示了如何使用fit_rectangle2_contour_xld来检测金属零件上冲孔的制造错误,如孔洞内金属小突起。通过鲁棒地(即,具有异常抑制)拟合孔洞边缘的矩形,并使用dist_rectangle2_contour_points_xld计算边缘到矩形边的距离来检测这些错误。由于孔洞的角落略有圆润,因此需要额外处理以忽略错误检查中的角落。
摘要由CSDN通过智能技术生成