*读取一张图像
read_image (Image, '求网格的顶点.png')
*获取图像大小
get_image_size (Image, Width, Height)
*关闭已经打开的窗口
dev_close_window ()
*打开新窗口
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
*对图像均值滤波,滤波核大小3*3
mean_image(Image, ImageMean, 3, 3)
*对图像均值滤波,滤波核大小12*12
mean_image(Image, ImageMean2, 12, 12)
*通过局部阈值分割出网格区域
dyn_threshold(ImageMean, ImageMean2, RegionDynThresh, 5, 'dark')
*对网格区域进行连通处理
connection(RegionDynThresh, ConnectedRegions)
*过滤出网格区域
select_shape(ConnectedRegions, SelectedRegions, 'area', 'and', 150, 9999999999)
*开运算,获取网格竖线
opening_rectangle1(SelectedRegions, RegionOpening1, 1, 10)
*开运算,获取网格横线
opening_rectangle1(SelectedRegions, RegionOpening2, 10, 1)
*交集运算,获取横线和竖线的交点
intersection(RegionOpening1, RegionOpening2, RegionIntersection)
*对交点区域进行连通处理
connection(RegionIntersection, ConnectedRegions1)
*获取交点的坐标位置:行,列坐标
area_center (ConnectedRegions1, Area, Row, Column)
*显示图像
dev_display (Image)
*显示网格交点
dev_display (ConnectedRegions1)
03-13
1527
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-27
452
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-26
11-15
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交