How would I create a function to return a Look-up table containing the transfer function for increasing/decreasing the brightness of an image in a given amount?
Show older comments
I am trying to create a function that returns a Look-up table containing the transfer function for increasing/decreasing brightness as follows;
if inputvalue < -c
outputvalue = 0
else if inputvalue > 255 - c
outputvalue = 255
else
outputvalue = inputvalue + c
Here is my attempt...
function Lut = brightnessLUT(c)
Lut = 1:256;
if c < 0
Lut = 0;
else if c > 255
Lut = 1:256;
else
Lut = 1:c;
end
Lut = uint8(Lut);
end
Would this be correct? When I use another function I to enhance an inputted image with the amount of c it doesn't seem to affect the brightness at all and the inputted image just stays the same. Any help would be great.
function Iout = enhanceBrightness(Iin,c)
Lut = brightnessLUT(c);
Iout = intlut(Iin,Lut);
end
Answers (0)
Categories
Find more on Image Preview and Device Configuration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!