- this example shows how to detect mura defects
- in blurred images
dev_close_window ()
dev_update_off ()
Path := ‘C:/Users/shang/Desktop/新建文件夹2/Image_’
read_image (Image, Path + ‘01’)
get_image_size (Image, Width, Height)
dev_open_window_fit_size (0, 0, Width, Height, 640, 480, WindowHandle)
set_display_font (WindowHandle, 14, ‘mono’, ‘true’, ‘false’)
dev_set_draw (‘margin’)
dev_set_line_width (3)
dev_set_color (‘red’)
ScaleFactor := 0.4
calculate_lines_gauss_parameters (17, [25,3], Sigma, Low, High)
for f := 1 to 3 by 1
read_image (Image, Path + f$’.2i’)
*decompose3 (Image, R, G, B)
* correct side illumination
*傅里叶变换
rft_generic (Image, ImageFFT, ‘to_freq’, ‘none’, ‘complex’, Width)
*生成高斯滤波器
gen_gauss_filter (ImageGauss, 100, 100, 0, ‘n’, ‘rft’, Width, Height)
*高斯滤波器卷积
convol_fft (ImageFFT, ImageGauss, ImageConvol)
*傅里叶变换
rft_generic (ImageConvol, Imag

该博客介绍了一种在模糊图像中检测瑕疵的方法。通过傅里叶变换、高斯滤波、图像减法和腐蚀等步骤,结合亚像素线条检测,实现了对图像中瑕疵的有效识别。在处理过程中,利用了仿射变换对线条进行校正,并通过图像放大观察,提高了检测精度。
最低0.47元/天 解锁文章

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



