|
- lines_guass:图像的每一点求hessian矩阵,对hessian矩阵求解特征值,特征值的正负,反映该点的方向,特征值的大小反映该点的能量
复制代码- dev_close_window ()
- dev_update_off ()
- Path := 'lcd/mura_defects_blur_'
- 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 (B, 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, ImageFFT1, 'from_freq', 'none', 'byte', Width)
- sub_image (B, ImageFFT1, ImageSub, 2, 100)
- * perform the actual inspection
- zoom_image_factor (ImageSub, ImageZoomed, ScaleFactor, ScaleFactor, 'constant')
- * avoid border effects when using lines_gauss()
- get_domain (ImageZoomed, Domain)
- erosion_rectangle1 (Domain, RegionErosion, 7, 7)
- reduce_domain (ImageZoomed, RegionErosion, ImageReduced)
- lines_gauss (ImageReduced, Lines, Sigma, Low, High, 'dark', 'true', 'gaussian', 'true')
- hom_mat2d_identity (HomMat2DIdentity)
- hom_mat2d_scale_local (HomMat2DIdentity, 1 / ScaleFactor, 1 / ScaleFactor, HomMat2DScale)
- affine_trans_contour_xld (Lines, Defects, HomMat2DScale)
- *
- dev_display (Image)
- dev_display (Defects)
- if (f < 3)
- disp_continue_message (WindowHandle, 'black', 'true')
- stop ()
- endif
- endfor
复制代码
说明: lines_gauss (ImageReduced, Lines, Sigma, Low, High, 'dark', 'true', 'gaussian', 'true'):算子输入参数难以控制;
lines_gauss受图像大小限制,较大的分辨率图像需要缩小才能使用 lines_gauss算子,这点类似于SVD算子进行背景重构一样。
高斯高通滤波:增强图像边缘纹理信息;
具体的lines_guass算子的作者可查阅:carsten steger -- curved lines
参考文献:Extraction of curved lines from images C. Steger
Removing the bias from line detection C. Steger
Improved curve tracing in images C. Steger
An unbiased detector of curvilinear structures C. Steger
|
|