Halcon之select_shape_xld是支持多个参数过滤的

例如:


select_shape_xld (Edges, SelectedXLD, ['compactness','contlength'], 'and', [1,30], [5,200])


select_shape_xld (Contours, SelectedXLD, ['width', 'height'], 'and', [400, 40], [99999, 99999])


* Image Acquisition
list_files ('C:/Users/Administrator/Desktop/', ['files','follow_links'], ImageFiles)
tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$','ignore_case'], ImageFiles)
for Index := 0 to |ImageFiles| - 1 by 1
    read_image (Image, ImageFiles[Index])
    * Image Acquisition 01: Do something
    edges_sub_pix (Image, Edges, 'canny', 5, 5, 40)
    select_shape_xld (Edges, SelectedXLD, ['compactness','contlength'], 'and', [1,30], [5,200])
    smallest_rectangle2_xld (SelectedXLD, Row, Column, Phi, Length1, Length2)
    gen_rectangle2_contour_xld (Rectangle, Row, Column, Phi, Length1, Length2)
    dev_display (Image)
    dev_display (Rectangle)
    stop ()
endfor
上一篇:内功!又是特么的内功?!


下一篇:【基础中的基础】引用类型和值类型,以及引用传递和值传递