指数分布噪声图像
clc,clear,close all
warning off
feature jit off
im = imread('coloredChips.png');
Z1 = imnoise_exponential(size(im,1),size(im,2),2,3);
Z1 = uint8(Z1); % 類型轉換
figure('color',[1,1,1]),
im(:,:,1) = im(:,:,1) + Z1; % R
im(:,:,2) = im(:,:,2) + Z1; % G
im(:,:,3) = im(:,:,3) + Z1; % B
subplot(121); imshow(im);title('加指數分布噪聲圖像')
subplot(122); imhist(Z1); title('加指數分布噪聲圖像直方圖')
function R = imnoise_exponential(M, N, a,b)
% input:
% 指數exponential分布,噪聲的類型;
% M,N:輸出噪聲圖像矩陣的大小
% a,b:各種噪聲的分布參數
% output:
% R: 輸出的噪聲圖像矩陣,數據類型為double型
% 設定默認值% 產生指數分布噪聲if nargin <= 3a = 1; b = 0.25;endR = a*exp(b*randn(M, N));
end
總結
- 上一篇: 图像添加柯西分布噪声
- 下一篇: F分布噪声图像