任务是内嵌下图的时间戳。我使用MATLAB的inpaintCoherent,但结果并不令人满意。我已经附上了原始图像,蒙版和内画的图像。这是MATLAB代码。
bill = imread('Billiards_ref.png');
mask = imread('mask.png');
bill_inpainted = inpaintCoherent(bill, logical(mask));
imshowpair(bill, bill_inpainted, 'montage')我可以做什么图像的预处理或后处理来提高修复的质量?
原始图像

蒙版图像

内画的形象

发布于 2020-05-12 23:41:19
在使用inpaintCoherent之前,您可能需要考虑模糊遮罩图像。这将需要一些试验和错误,看看有多少平滑可以给你最好的图像。根据你在问题中发布的图片,以下是我可以提出的建议和结果:
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));

https://stackoverflow.com/questions/61746551
复制相似问题