- list_files ('C:/Users/Administrator/Desktop/新建文件夹', ['files','follow_links','recursive'], 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 02: Do something
- mean_image (Image, ImageMean, 10, 199)
- emphasize (ImageMean, ImageEmphasize, 77, 77, 15)
- edges_sub_pix (ImageEmphasize, Edges, 'canny', 2, 30, 60)
- union_adjacent_contours_xld (Edges, UnionContours, 2, 1, 'attr_keep')
- length_xld (UnionContours, Length)
- tuple_sort_index (Length, Indices)
- tuple_inverse (Indices, Inverted)
- select_obj (UnionContours, ObjectSelected, Inverted[0:1]+1)
- dev_display (Image)
- dev_display (ObjectSelected)
- stop ()
- endfor
复制代码 |