螺纹表面缺陷检测
By
笑口常开
at 2019-03-19 • 0人收藏 • 2007人看过
read_image (Image222, 'C:/Users/popdes/Desktop/38.bmp') get_image_size (Image222, Width, Height) dev_set_draw ('margin') dev_set_line_width (3) dev_set_color ('red') optimize_rft_speed (Width, Height, 'standard') Sigma1 := 10.0 Sigma2 := 3.0 gen_gauss_filter (GaussFilter1, Sigma1, Sigma1, 0.0, 'none', 'rft', Width, Height) gen_gauss_filter (GaussFilter2, Sigma2, Sigma2, 0.0, 'none', 'rft', Width, Height) sub_image (GaussFilter1, GaussFilter2, Filter, 1, 0) rgb1_to_gray (Image222, Image) rft_generic (Image, ImageFFT, 'to_freq', 'none', 'complex', Width) convol_fft (ImageFFT, Filter, ImageConvol) rft_generic (ImageConvol, ImageFiltered, 'from_freq', 'n', 'real', Width) scale_image (ImageFiltered, ImageScaled, 16.8539, 720) threshold (ImageScaled, Regions, -1953.78, 203.08) connection (Regions, ConnectedRegions) select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 0, 645.12)
未完成 ,题目来源于http://www.ihalcon.com/read-9195-1.html
登录后方可回帖