设置首页收藏本站
开启左侧

使用opencv如何去除标记划痕

[复制链接]
欢喜 发表于 2022-12-18 20:00:47 | 显示全部楼层 |阅读模式
各位大佬,请问一下这个图片该怎么使用opencv去标记划痕
下面是halcon的代码
  1. read_image (Image, 'C:/个人文件/机器视觉/第十课/IMG_1052.JPG')
  2. get_image_size (Image, Width, Height)
  3. dev_open_window (0, 0, Width/4, Height/4, 'black', WindowHandle)
  4. dev_display (Image)
  5. dev_set_line_width (4)
  6. threshold (Image, Region, 128, 255)
  7. reduce_domain (Image, Region, ImageReduced)
  8. gen_gauss_filter (ImageGauss, 30, 30, 0, 'none', 'rft', Width, Height)
  9. gen_gauss_filter (ImageGauss1, 3, 3, 0, 'none', 'rft', Width, Height)
  10. * sub_image (ImageGauss, ImageGauss1, ImageSub, 1, 0)
  11. rgb1_to_gray (ImageReduced, GrayImage)
  12. rft_generic (GrayImage, ImageFFT, 'to_freq', 'none', 'complex', Width)
  13. convol_fft (ImageFFT, ImageSub, ImageConvol)
  14. rft_generic (ImageConvol, ImageFFT1, 'from_freq', 'n', 'real', Width)
  15. scale_image_range (ImageFFT1, ImageScaled, 0, 255)
  16. threshold (ImageScaled, Region1, 0, 1)
  17. erosion_circle (Region1, RegionErosion, 11)
  18. connection (RegionErosion, ConnectedRegions)
  19. select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 800, 9000)
  20. dev_display (Image)
  21. dev_display (SelectedRegions)
复制代码

4.png
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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