Hello Mat

 找回密码
 立即注册
查看: 8099|回复: 0

Lines_Guass提取线缺陷

[复制链接]

1323

主题

1551

帖子

0

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22647
发表于 2016-10-12 00:38:47 | 显示全部楼层 |阅读模式
  1. lines_guass:图像的每一点求hessian矩阵,对hessian矩阵求解特征值,特征值的正负,反映该点的方向,特征值的大小反映该点的能量
复制代码
  1. dev_close_window ()
  2. dev_update_off ()
  3. Path := 'lcd/mura_defects_blur_'
  4. read_image (Image, Path + '01')
  5. get_image_size (Image, Width, Height)
  6. dev_open_window_fit_size (0, 0, Width, Height, 640, 480, WindowHandle)
  7. set_display_font (WindowHandle, 14, 'mono', 'true', 'false')
  8. dev_set_draw ('margin')
  9. dev_set_line_width (3)
  10. dev_set_color ('red')
  11. ScaleFactor := 0.4
  12. calculate_lines_gauss_parameters (17, [25,3], Sigma, Low, High)
  13. for f := 1 to 3 by 1
  14.   read_image (Image, Path + f.2i')
  15.   decompose3 (Image, R, G, B)
  16.   * correct side illumination
  17.   rft_generic (B, ImageFFT, 'to_freq', 'none', 'complex', Width)
  18.   gen_gauss_filter (ImageGauss, 100, 100, 0, 'n', 'rft', Width, Height)
  19.   convol_fft (ImageFFT, ImageGauss, ImageConvol)
  20.   rft_generic (ImageConvol, ImageFFT1, 'from_freq', 'none', 'byte', Width)
  21.   sub_image (B, ImageFFT1, ImageSub, 2, 100)
  22.   * perform the actual inspection
  23.   zoom_image_factor (ImageSub, ImageZoomed, ScaleFactor, ScaleFactor, 'constant')
  24.   * avoid border effects when using lines_gauss()
  25.   get_domain (ImageZoomed, Domain)
  26.   erosion_rectangle1 (Domain, RegionErosion, 7, 7)
  27.   reduce_domain (ImageZoomed, RegionErosion, ImageReduced)
  28.   lines_gauss (ImageReduced, Lines, Sigma, Low, High, 'dark', 'true', 'gaussian', 'true')
  29.   hom_mat2d_identity (HomMat2DIdentity)
  30.   hom_mat2d_scale_local (HomMat2DIdentity, 1 / ScaleFactor, 1 / ScaleFactor, HomMat2DScale)
  31.   affine_trans_contour_xld (Lines, Defects, HomMat2DScale)
  32.   *
  33.   dev_display (Image)
  34.   dev_display (Defects)
  35.   if (f < 3)
  36.     disp_continue_message (WindowHandle, 'black', 'true')
  37.     stop ()
  38.   endif
  39. 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

算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-11-22 18:39 , Processed in 0.230370 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表