Image won`t output after noising.
Show older comments
I want to noise and then de-noise a "tire" image using 'salt & pepper', but I can't get a noised and de-noised image to output properly. The same happens with 'facets'.
load facets; nbc = size(map,1);
Y = imnoise(X,'salt & pepper',0.5);
colormap(gray(nbc));
subplot(221), image(wcodemat(X,nbc)); title('Original image');
subplot(222), image(wcodemat(Y,nbc)); title('Noised image');


load tire; nbc = size(map,1); wname = 'coif2'; lev = 3;
Y = imnoise(X,'salt & pepper',0.1);
[c,s] = wavedec2(Y,lev,wname);
det1 = detcoef2('compact',c,s,1);
sigma = median(abs(det1))/0.6745;
alpha = 5;
thr = wbmpen(c,3,sigma,alpha);
keepapp = 1;
xd = wdencmp('gbl',c,s,wname, lev,thr,'s',keepapp);
colormap(gray(nbc));
subplot(331), image(wcodemat(X,nbc)); title('Original image');
subplot(332), image(wcodemat(Y,nbc)); title('Noised image');
subplot(333), image(wcodemat(xd,nbc)); title('De-noised image');
4 Comments
Walter Roberson
on 12 Jun 2023
Please include enough code and data that we can test it.
Walter Roberson
on 12 Jun 2023
Try imagesc() instead of image()
Mykola
on 12 Jun 2023
Mykola
on 12 Jun 2023
Accepted Answer
More Answers (0)
Categories
Find more on Orange in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
