Halcon 将圆形网格图片转换为黑白棋盘
- 首先,使用 Halcon 的 read_image 函数读取圆形网格图片。
- 然后,使用 gen_grid_points 函数生成网格点坐标。
- 接下来,使用 gen_region_points 函数将网格点坐标转换为区域。
- 使用 paint_region 函数将区域内的像素填充成黑白棋盘样式。
- 最后,使用 write_image 函数保存处理后的图像。
下面是示例代码:
read_image(Image, 'circle_grid.png')
gen_grid_points(GridPoints, 10, 10, 100, 100, 5, 5)
gen_region_points(GridPoints, Region)
paint_region(Region, Image, ImageOut, 0, 'fill')
write_image(ImageOut, 'circle_grid_chessboard.png')
原文地址: https://www.cveoy.top/t/topic/nKm7 著作权归作者所有。请勿转载和采集!