read_image(Image, 'C:/Users/86173/Desktop/test/4.png')
get_image_size(Image, Width, Height)
dev_close_window()
dev_open_window(0, 0, Width, Height, 'black', WindowHandle)
dev_display(Image)
rgb1_to_gray(Image, GrayImage)
gray := 88
threshold(GrayImage, Region, gray, 255) //全局阈值
binary_threshold(GrayImage, Region1, 'max_separability', 'dark', UsedThreshold) //将灰度图像转换为二值图像的函数
mean_image(GrayImage, ImageMean, 15, 15) //均值滤波(计算图像像素值的平均值的函数)
dyn_threshold(GrayImage, ImageMean, RegionDynThresh, 15, 'light') //动态阈值(根据局部图像信息动态计算阈值的函数。它使用自适应算法来确定每个像素的最佳阈值,从而创建更准确和鲁棒的二值图像)

本文介绍了在Python中使用图像处理技术,包括获取图像尺寸、窗口操作、灰度转换、阈值处理(全局和自适应),以及均值滤波的过程,以实现更准确的二值图像处理。
3824

被折叠的 条评论
为什么被折叠?



