1.之前研究OpenCV的图像修复时,知道Opencv提供的inpaint API能够实现这个效果。

void inpaint(

InputArray src, 原图

InputArray inpaintMask, 二进制掩模,指示要修复的像素

OutputArray dst, 目标图像

double inpaintRadius, 像素周围的邻域补绘。通常,如果要修复的区域很小,则使用较小的值仅产生较少模糊

int flags INPAINT_NS 或 INPAINT_TELEA

)
2.今天研读halcon算子时发现Halcon也有相对应的图像修复算子,而且效果还非常好。以下是算子和案例。
2.1 inpainting_aniso

功能:通过各向异性扩散执行图像修复。

2.2 inpainting_ced

功能:通过一致性增强扩散执行图像修复。

2.3 inpainting_ct

功能:通过连贯传送执行图像修复。

2.4 inpainting_mcf

功能:通过水平线平滑执行图像修复。

2.5 inpainting_texture

功能:通过结构传导执行图像修复。
3.摘取其中两个常用的算子讲解
3.1案例

  • This example program shows how inpainting_ct can be used to remove the
  • fence from an image of a lynx.
    read_image (Image, ‘lynx’)
    get_image_size (Image, Width, Height)
    dev_close_window ()
    dev_open_window (0, 0, Width, Height, ‘black’, WindowHandle)
    set_display_font (WindowHandle, 16, ‘mono’, ‘true’, ‘false’)
    dev_display (Image)
    Message := ‘Image to be inpainted’
    disp_message (WindowHandle, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    stop ()
    read_region (Region, ‘lynx_mask’)
    dev_display (Image)
    dev_set_color (‘blue’)
    dev_display (Region)
    Message := ‘Inpainting region’
    disp_message (WindowHandle, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    stop ()
    inpainting_ct (Image, Region, InpaintedImage, 13, 70, 1.2, 4, 1)
    dev_display (InpaintedImage)
    Message := ‘Inpainted image’
    disp_message (WindowHandle, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    原图

    结果图

    3.2 案例2
  • This example program shows how inpainting_texture can be used to remove
  • unwanted objects from an image and replace them with natural looking
  • texture
    dev_update_off ()
    read_image (Image, ‘plit2’)
    get_image_size (Image, Width, Height)
    dev_close_window ()
    dev_open_window (0, 0, Width, Height, ‘black’, WindowHandle)
    set_display_font (WindowHandle, 16, ‘mono’, ‘true’, ‘false’)
    decompose3 (Image, ImageR, ImageG, ImageB)
    trans_from_rgb (ImageR, ImageG, ImageB, ImageH, ImageS, ImageV, ‘hsv’)
    threshold (ImageV, Region, 0, 120)
    reduce_domain (ImageS, Region, ImageReduced)
    threshold (ImageReduced, Region, 0, 120)
    dilation_circle (Region, RegionDilation, 2.5)
    opening_circle (RegionDilation, RegionTrees, 6.5)
    dev_display (Image)
    Message := ‘Original image’
    disp_message (WindowHandle, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    stop ()
    dev_display (Image)
    dev_set_color (‘white’)
    dev_set_draw (‘margin’)
    dev_set_line_width (3)
    dev_display (RegionTrees)
    Message := ‘Region to be inpainted’
    disp_message (WindowHandle, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    stop ()
    inpainting_texture (Image, RegionTrees, InpaintedImage, 11, 40, 0, ‘none’, 0)
    dev_display (InpaintedImage)
    Message := ‘Result of the inpainting’
    disp_message (WindowHandle, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    原图

    结果图

Halcon图像修复相关推荐

  1. 图像修复 图像补全_图像修复简介

    图像修复 图像补全 In practical applications, images are often corroded by noise. These noises are dust or wa ...

  2. Inpainting图像修复halcon算子,持续更新

    目录 harmonic_interpolation inpainting_aniso inpainting_ced inpainting_ct inpainting_mcf inpainting_te ...

  3. 结构感知图像修复:ICCV2019论文解析

    结构感知图像修复:ICCV2019论文解析 StructureFlow: Image Inpainting via Structure-aware Appearance Flow 论文链接: http ...

  4. Python,OpenCV中的图像修复——cv2.inpaint()

    Python,OpenCV中的图像修复--cv2.inpaint 1. 效果图 2. 原理 3. 源码 参考 image inpainting 图像修改 这篇博客将介绍如何通过OpenCV中图像修复的 ...

  5. 使用Python,OpenCV进行去水印,图像修复

    图像修复是图像保存和图像恢复的一种形式,其历史可以追溯到1700年代,当时意大利威尼斯的公共图片修复总监彼得·爱德华兹(Pietro Edwards)应用这种科学方法来修复和保存著名作品(资料来源). ...

  6. 利用OpenCV实现图像修复(含源码链接)

    点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 前一段时间小白分享过关于图像修复技术介绍的推文(点击可以跳转),有 ...

  7. 从暗通道先验去雾到海底图像修复-三维重建辅助计算摄影

    点击上方"小白学视觉",选择加"星标"或"置顶"重磅干货,第一时间送达 一. Sea Thru:海底图像修复 我想很多朋友一定看过海底的各种 ...

  8. OpenCV中图像修复技术介绍与演示

    点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 本文转自:opencv学堂 现实中图像经常出现划伤或者被噪声腐蚀或 ...

  9. 【OpenCV 4开发详解】图像修复

    本文首发于"小白学视觉"微信公众号,欢迎关注公众号 本文作者为小白,版权归人民邮电出版社发行所有,禁止转载,侵权必究! 经过几个月的努力,小白终于完成了市面上第一本OpenCV 4 ...

最新文章

  1. React 深入系列3:Props 和 State
  2. 新人工智能算法速度无极限
  3. BC #49 1001 Untitled
  4. ​模型优化漫谈:BERT的初始标准差为什么是0.02?
  5. Spring Boot基本配置
  6. 穷举法破解集合小游戏~
  7. 揭秘高德地图如何利用MaxCompute管理海量数据
  8. 顺风车订单已结束仍在录音 嘀嗒出行回应录音机制
  9. html中右边线条怎么写,html5 三角形的线条怎么写
  10. python pymysql模块 链接mysql 遍历查询结果的方法 详解
  11. 比较使用LUT和不使用LUT的颜色空间转换的处理时间差异
  12. YaoLingJump开发者日志(四)
  13. IDEA引MAVEN项目jar包依赖导入问题解决
  14. linux_nmon监控教程,如何使用Nmon监控Linux系统性能
  15. 开发过程中解决各种跨域问题
  16. cssmatic gradient css generator,10 Best CSS Gradient Generators
  17. MapGuide应用最佳实践—MapGuide Server和MapGuide WebExtension分开部署
  18. Python爬虫开源项目代码分享,100个
  19. wordpress媒体库增加分类和标签
  20. matlab和numpy的ones用法

热门文章

  1. 2022.10.14 英语背诵
  2. Word文档排版——自动编号
  3. 中职计算机应用教学的重要性,中职《计算机应用基础》教学中理实一体化的有效开展...
  4. 计算机整体硬盘销毁,如何完全销毁硬盘上的数据?
  5. java吸血鬼数字_吸血鬼数字的简单实现
  6. iceberg-flink 九:累积窗口按照天统计,数据不是从0:00-11:59 统计。
  7. 多多参谋参谋|拼多多店群什么产品容易成为爆款呢|魔店分享
  8. 绿能宝承载的不单是绿能宝的梦想
  9. 第6例:菲波那切数列
  10. 铁路 信号组调工 技师 练习题 01