필터 지우기
필터 지우기

How can i modify matrix which i retrieve from image?

조회 수: 1 (최근 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 CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by