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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 8 日

1 投票

mask = pic3 > 0; % mask for non-zero values of pic3
pic3(mask) = pic3(mask) - 80;

2 件のコメント

lech king
lech king 2020 年 10 月 8 日
thank you so much
Ameer Hamza
Ameer Hamza 2020 年 10 月 8 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索

製品

リリース

R2019b

タグ

質問済み:

2020 年 10 月 8 日

コメント済み:

2020 年 10 月 8 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by