Perform operations on non-zero locations of the matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
lech king
am 8 Okt. 2020
Kommentiert: Ameer Hamza
am 8 Okt. 2020
pic1=rgb2gray(pic);
pic2 = imnoise(pic1,'salt & pepper',0.05);
%%%%%%%Hard Thresholding%%%%%%
Container=pic2>80;
Container=uint8(Container);
pic3=pic2.*Container;
Hi
this is my Hard Thresholding in pic3
now i want Soft Thresholding by subtracting the places have non-zero values in pic3 from 80 without using a loop
Thanks for your guidance
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 8 Okt. 2020
mask = pic3 > 0; % mask for non-zero values of pic3
pic3(mask) = pic3(mask) - 80;
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!