read_image(image, ‘particle’)
get_image_size(image, width, height)
dev_open_window(0, 0, width, height, ‘black’, WindowHandle)
dev_set_draw(‘margin’)
dev_set_color(‘green’)
threshold(image, Region, 128, 255)
connection(Region, ConnectedRegions)
select_shape_std(ConnectedRegions, SelectedRegions, ‘max_area’, 70) //选择面积最大的区域
area_center(SelectedRegions, Area, Row, Column)//获取区域的面积大小,中心点的横坐标和列坐标
dev_display(image)
dev_display(SelectedRegions)
set_tposition(WindowHandle, height/2, 0)
write_string(WindowHandle, ‘面积最大区域的行坐标:’ + Row + ‘面积最大区域的列坐标’ + Column)