首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >图像修复| inpaintCoherent()

图像修复| inpaintCoherent()
EN

Stack Overflow用户
提问于 2020-05-12 15:58:26
回答 1查看 187关注 0票数 2

任务是内嵌下图的时间戳。我使用MATLAB的inpaintCoherent,但结果并不令人满意。我已经附上了原始图像,蒙版和内画的图像。这是MATLAB代码。

代码语言:javascript
复制
bill = imread('Billiards_ref.png');
mask = imread('mask.png');
bill_inpainted = inpaintCoherent(bill, logical(mask));
imshowpair(bill, bill_inpainted, 'montage')

我可以做什么图像的预处理或后处理来提高修复的质量?

原始图像

蒙版图像

内画的形象

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-05-12 23:41:19

在使用inpaintCoherent之前,您可能需要考虑模糊遮罩图像。这将需要一些试验和错误,看看有多少平滑可以给你最好的图像。根据你在问题中发布的图片,以下是我可以提出的建议和结果:

代码语言:javascript
复制
bill = imread('Billiards_ref.jpg'); % Image you included is a jpg file
mask = imread('mask.png');

% Create a blurred mask using a 2D Gaussian kernel with std dev std_dev (in pixel units)
std_dev = 1; % You may want to change this for different images depending on what the resolution of the original mask is
mask_bl = imgaussfilt(double(mask), std_dev);

bill_inpainted = inpaintCoherent(bill, logical(mask_bl));

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61746551

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档