How to replace a value in a matrix of pixels using matlab ?

조회 수: 2 (최근 30일)
dhaarani chandrasekaran
dhaarani chandrasekaran 2017년 2월 13일
댓글: dhaarani chandrasekaran 2017년 2월 14일
I have a 225*225 image.I don't know how to replace a pixel value using indices value.please reply as soon as possible.
Thanks in advance.
  댓글 수: 1
dhaarani chandrasekaran
dhaarani chandrasekaran 2017년 2월 14일
I have tried this code.But I am trying to replace values in a matrix based on some conditions without loop. please reply as soon as possible.

댓글을 달려면 로그인하십시오.

답변 (1개)

mizuki
mizuki 2017년 2월 14일
If you want to replace the pixel (i,j)=(100,125) of the variable img with 0.2, use the following code:
i = 100;
j = 125;
img(i,j) = 0.2;

제품

Community Treasure Hunt

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

Start Hunting!

Translated by