So, it's actually just a simple scaling of image intensitiesscaling of image intensities (with cut-offs). Also, the default call to imadjust
with only an image as an input parameter should increase contrast. I'd say that imadjust(I2)
wouldn't do anything (there's a maximum contrast in my second example).
On intensity adjustment
In term of greyscale image, the intensity of the pixel corresponds to it's brightness. The greater the intensity, the greater the brightness. This also means that increasing intensity can be viewed as brightening the image (while decreasing intensity can be viewed as darkening the image).
I would describe the process of uniformly brightening the image as increasing intensity while leaving the contrast unchanged in the whole image.
This actually means adding a constant value to all the pixels.
Now, as the pixel intensity values have a predefined range, typically [0..255], this means that the maximum intensity exists. This inevitably means that some pixels (that were different from each other before) will become white (i.e. intensity 255).
This "naturally" happens when you take a photo aimed towards something very bright -- sun or other light. Away from the light, you might see some details, but at the position of the light/sun and around it, you will get only white pixels meaning that the intensity (amount of light when the image was taken) "hit" its maximum (displayable/storable) value.
The only way you wouldn't lose details by this operation would be if the original pixel intensities belong to only a part of possible intensity range, e.g. if original pixels are in the range [10, 150], the image could be brightened by up to 105 intensity levels before you start to loose details.
As imgadjust
is meant to preform intensity scaling, it can do much more than just brighten/darken image. If you wanted to emulate brightening effect with imadjust
, you could write something like:
imadjust(I, [0.0; x], [1.0-x; 1.0])
where x
is any number between 0 and 1 (e.g. x=0.5
would brighten a [0..255] image by 127).
That said, this is an overkill for such a simple operation. I'm sure matlab has a elementary operation that adds a scalar to all elements of a matrix, so you could just use that :)