フィルターのクリア

How can i modify matrix which i retrieve from image?

4 ビュー (過去 30 日間)
Umme Tania
Umme Tania 2013 年 6 月 19 日
I have a gray image, i want to see only the black part ,rest of image i want to replace with value 250, so that gray part will be white.
f=imread('image1.jpg');
T = zeros(size(f));
for ii = 1:numel(f)
if f(ii)<50
T(ii) = f(ii);
else
T(ii) = 250;
end
end
imshow(T)
  5 件のコメント
Evan
Evan 2013 年 6 月 19 日
What's the minimum value of your image?
Umme Tania
Umme Tania 2013 年 6 月 19 日
40

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

採用された回答

Iain
Iain 2013 年 6 月 19 日
Try:
%if the problem is just the data type, this should work:
T = f;
T(T>50) = 255;
If the problem is that you can't see the very few black pixels, tell us the result from
sum(f(:) <51)
  1 件のコメント
Umme Tania
Umme Tania 2013 年 6 月 19 日
編集済み: Umme Tania 2013 年 6 月 19 日
Thanks.........now it's working

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by