找区域面积和中心点
*获取图像
read_image (Image, 'fabrik')
*关闭窗口
dev_close_window ()
*打开窗口
dev_open_window (0, 0, 512, 512, 'black', WindowID)
*设置输出字体,14号字,Courier字体,粗体
set_display_font (WindowID, 14, 'mono', 'true', 'false')
*设置输出颜色
dev_set_colored (6)
*进行区域生长操作
regiongrowing (Image, Regions, 1, 1, 3, 200)
*显示区域
dev_display (Regions)
*计算所有不相连区域的面积和中心点坐标
area_center (Regions, Area, Row, Column)
center:=|Area|
*获取一个字符串的空间大小
* Ascent从基线到字符顶部的距离(上行高度)
* Descent从基线到字符底部的距离(下行高度)
get_string_extents (WindowID, 12345, Ascent, Descent, TxtWidth, TxtHeight)
*将面积计算结果以字符串形式显示在窗口中
for I := 0 to center-1 by 1disp_message (WindowID, Area[I], 'image', Row[I] - TxtHeight / 2, Column[I] - TxtWidth / 2, 'white', 'false')
endfor
