如何在没有补丁效果的情况下将色调映射噪声混合到图像中?

时间:2016-02-25 14:19:25

标签: image matlab image-processing

我想在面部图像(眼睛,嘴巴,鼻子)的特定区域创建色调映射(包括对比度变化,亮度变化,伽玛变化)。

我设法从图片中自动提取所需的功能。

我已使用imadjust创建对比度更改(例如)图像的特定功能,然后我使用vision.AlphaBlender和提取的蒙版混合它们领域

结果是下面的修补图片: Noised image

我应该怎么做才能将噪音功能融入原始图像中,产生自然效果而不会创建斑驳的图像?

1 个答案:

答案 0 :(得分:0)

我的问题的答案是采取提取区域的掩码。 在掩模上应用高斯噪声,这将在掩模上产生模糊效果。

然后,通过加权应用原始图像上的模糊遮罩,将噪点自然地混合到图像中,这样就可以防止在我的问题中显示在附加图像上的任何补丁效果。

以下是代码段:

% create a guassian filter
G = fspecial('gaussian', [25 25], 20);
% blur the mask - make sure your original mask is a double type
blurredMask =  imfilter(mask,G,'same');
% blend the image , the noised image and the original 
% image by weighting with the blurred mask
image = originalImage.*(1-blurredMask ) + noisedImage.*blurredMask;

我希望我已经用我的问题和答案帮助了某人。