필터 지우기
필터 지우기

how to convert a gray level to another gray level in matlab?

조회 수: 5 (최근 30일)
fariba amini
fariba amini 2016년 4월 4일
댓글: fariba amini 2016년 4월 4일
i have an gray scale image.i want to change some gray level to another gray level.for example i want to convert all pixel with value 128 to 0 ,how can i do this?

채택된 답변

Walter Roberson
Walter Roberson 2016년 4월 4일
my_image =imread('YourImage.tif');
my_image(my_image == 128) = 0;

추가 답변 (1개)

Muhammad Usman Saleem
Muhammad Usman Saleem 2016년 4월 4일
my_image =imread('YourImage.tif');
for R=1:num of Rows
for C=1:num of Columns
pixel=my_image(R,C);
if pixel ==128
pixel=0;
end
end

Community Treasure Hunt

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

Start Hunting!

Translated by