Hello Mat

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

分水岭分割

[复制链接]

1323

主题

1551

帖子

0

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22647
发表于 2018-6-13 22:22:23 | 显示全部楼层 |阅读模式
分水岭分割:
  1. dev_update_off ()
  2. dev_set_draw ('margin')
  3. Path := 'lcd/mura_defects_texture_'
  4. read_image (Image, Path + '01')
  5. get_image_size (Image, Width, Height)
  6. * 测试图像
  7. read_image (Image, Path + '01')
  8. decompose3 (Image, R, G, B)
  9. * 高斯带阻滤波器
  10. get_image_size (B, Width, Height)
  11. rft_generic (B, ImageFFT, 'to_freq', 'none', 'complex', Width)
  12. gen_gauss_filter (ImageGauss, 50, 50, 0, 'n', 'rft', Width, Height)
  13. convol_fft (ImageFFT, ImageGauss, ImageConvol)
  14. rft_generic (ImageConvol, ImageFFT1, 'from_freq', 'none', 'byte', Width)
  15. * estimate_background_illumination
  16. sub_image (B, ImageFFT1, ImageSub, 2, 100)
  17. * median filter smooths out the fine texture, simplifying the following
  18. * segmentation and final detection of defects
  19. median_image (ImageSub, ImageMedian, 'circle', 9, 'mirrored')
  20. * 分水岭分割算法
  21. watersheds_threshold (ImageMedian, Basins, 20)
  22. * dark patches corresponding to defects have a very low energy
  23. cooc_feature_image (Basins, ImageMedian, 6, 0, Energy, Correlation, Homogeneity, Contrast)
  24. tuple_find (sgn(Energy - 0.05), -1, Indices)
  25. select_obj (Basins, Defects, Indices + 1)
  26. *
  27. dev_display (Image)
  28. dev_display (Defects)
复制代码



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-22 23:38 , Processed in 0.225807 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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