Open fdh0 opened 6 years ago
这是通过图像乘法的结果 这是通过傅立叶变换的结果
这是通过emphasize的效果
可见,傅立叶效果最好.
时间对比:
Mulit VS FFT VS emphasize 0.7 VS 3 VS 0.8
代码:
read_image (Image, FilePath) get_image_size (Image, Width, Height) dev_open_window (0, 0, Width/2, Height/2, 'black', WindowHandle) dev_display (Image)
rgb1_to_gray (Image, GrayImage) * 获取条形码区域 gen_rectangle1 (ROI_1, 26, 2395, 251.337, 2481.5) reduce_domain (GrayImage, ROI_1, ImageReduced1) area_center (ROI_1, Area, RowCenter, ColCenter) count_seconds (t1) crop_domain (ImageReduced1, ImageReduced) get_image_size (ImageReduced, Width1, Height1) * 傅里叶变换Width1应为偶数,否则耗时较长 if(Width1%2!=0) Width1 := Width1 + 1 zoom_image_size (ImageReduced, ImageReduced, Width1, Height1, 'constant') endif
invert_image (ImageReduced, ImageInvert) mult_image (ImageReduced, ImageReduced, ImageResult, 0.009, 0)
rft_generic (ImageResult, ImageFFT, 'to_freq', 'none', 'complex', Width1)
convol_fft (ImageFFT, ImageFilter, ImageConvol)
rft_generic (ImageConvol, Lines, 'from_freq', 'none', 'byte', Width1)
这是通过图像乘法的结果 这是通过傅立叶变换的结果
这是通过emphasize的效果
可见,傅立叶效果最好.
时间对比:
Mulit VS FFT VS emphasize 0.7 VS 3 VS 0.8
代码:
read_image (Image, FilePath)
get_image_size (Image, Width, Height) dev_open_window (0, 0, Width/2, Height/2, 'black', WindowHandle)
dev_display (Image)
invert_image (ImageReduced, ImageInvert) mult_image (ImageReduced, ImageReduced, ImageResult, 0.009, 0)
rft_generic (ImageResult, ImageFFT, 'to_freq', 'none', 'complex', Width1)
convol_fft (ImageFFT, ImageFilter, ImageConvol)
rft_generic (ImageConvol, Lines, 'from_freq', 'none', 'byte', Width1)