fdh0 / files

Save all the files needed
0 stars 1 forks source link

add_grayval #1

Open fdh0 opened 6 years ago

fdh0 commented 6 years ago

_2018-08-14_03-48-50_2018-08-14_03-49-09 这是通过图像乘法的结果 _2018-08-14_03-49-09_2018-08-14_03-50-47 这是通过傅立叶变换的结果

_2018-08-14_03-48-50_2018-08-14_04-00-16 这是通过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