필터 지우기
필터 지우기

How to change brightness of selected points of an image?

조회 수: 2 (최근 30일)
Ali Purse
Ali Purse 2018년 10월 18일
답변: Image Analyst 2018년 10월 18일
I know that I can change brightness of an image using following instruction:
I=(readimage);
I1 = I - 100;
imshow(I1);
But I want to know that How can I change brightness of the image just in some specified points? For example a square of the image?
  댓글 수: 2
Kevin Chng
Kevin Chng 2018년 10월 18일
Indexing your I will do
I([10 50],[10 50],:) = I([10 50],[10 50],:) - 100;
Ali Purse
Ali Purse 2018년 10월 18일
May you please help me that what are the numbers?

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

답변 (1개)

Image Analyst
Image Analyst 2018년 10월 18일
Try ginput():
uiwait(helpdlg('Click a point'));
[x, y] = ginput(1);
row = round(y);
col = round(x);
thisGrayLevel = grayImage(row, col);
grayImage(row, col) = thisGrayLevel ^2;
Beware that if your image is uint8 and the square goes beyond 255, it will clip to 255.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by