i need to brighten or darken an 8 bit image by taking an input , a number between 0 (means no change ) and 100 (means intensity of all pixels is 255 ) , can anyone help ??

1 回表示 (過去 30 日間)
the aim is to perform brightness correction or contrast improvement using suggested algorithm !

回答 (1 件)

Image Analyst
Image Analyst 2015 年 3 月 3 日
編集済み: Image Analyst 2015 年 3 月 4 日
It's simple algebra:
image1 = imread('cameraman.tif');
minValue = double(min(image1(:)))
maxValue = double(max(image1(:)))
slope = (255 - minValue)/100
v = 100; % Whatever you want in the range 0-100.
amountToAdd = slope * v
image2 = uint8(image1 + amountToAdd);
imshow(image2);
newMinValue = double(min(image2(:)))
newMaxValue = double(max(image2(:)))
  2 件のコメント
Amir
Amir 2015 年 3 月 4 日
its not effective at all . whether i enter 10 or 90 ,there is no visible difference. any other way ??
Image Analyst
Image Analyst 2015 年 3 月 4 日
I made a small edit. Try it now.

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

Community Treasure Hunt

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

Start Hunting!

Translated by