读取多图:
1,申明一个数组,分别保存路径
ImagePath:=[] ImagePath[0]:=
'D:/1.bmp' ImagePath[1]:=
'D:/2.bmp' ImagePath[2]:=
'D:/3.bmp'
for i:=0 to 2 by 1 read_image(Image,ImagePath[i]) endfor
2,for 循环
for i:=1 to 3 by 1 read_image(Image,
'D:/’+'i
'+'.bmp') endfor
3,遍历法
list_files( : : Directory, Options : Files)
文件格式筛选 tuple_regexp_select( : : Data, Expression : Selection)
代码部分:
list_files ('C:/Users/Public/Pictures/Sample Pictures', 'files', Files)
tuple_regexp_select (Files, ['\\.(bmp|jpg)$','ignore_case'], ImageFiles)
* 依次读取图片
for Index := 0 to |ImageFiles| - 1 by 1
read_image (Image, ImageFiles[Index])
wait_seconds (1)
binomial_filter (Image, ImageBinomial, 5, 5)
wait_seconds (1)
endfor
二 不规则区域的转换:
shape_trans(region,regiontrans,type)
convex hull凸包围(由外向内包围)
outer_circle 外圆(能够包括对象的半径最小的圆形)
inner_circle 内圆
rectangle1 正矩形
rectangle2 最小包围矩形
inner_rectangle1 最大内矩形三 图型变量XLD(eXtended Line Descriptions)
XLD代表亚像素级别的轮廓或者多边形
threshold_sub_pix(inputimage, output,requirement) gen_contour_region_xld(inputRegion,output,...)
XLD的选择操作(select_shape_xld/selet_contours_xld):
select_shape_xld(XLD:SelectedXLD:Features,Operation,Min,Max:) select_contours_xld(Contours:SelectedContours:Feature,Min1,Max1,Min2,Max2:)
计算xld的面积以及中心位置:
area_center_xld(XLD:::Area,row,column,pointOrder)
xld的合并操作:
union_colliner_contours_xld: 合并同一直线的xld union_cocircular_contours_xld: 合并同圆的xld union_adjacent_contours_xld: 合并相邻的xld
xld的转换操作与region类似:
shape_trans_xld(XLD:XLDTrans:Type:)
有上面几个类型
Xld的分割操作(segment_contours_xld)
把初始xld分割成直线,直线和圆,直线和椭圆
segment_contours_xld(Contours: ContoursSplit: Mode,SmoothCont, MaxLineDist1, MaxLineDist2:)
fit_rectangle2_contour_xld
Xld 的拟合操作(fit_***_contour_xld) 把不完整的形状拟合完整
fit_line_contour_xld
fit_circle_contour_xld
fit_ellipse_contour_xld
fit_circle_contour_xld
fit_ellipse_contour_xld