One way to normalize the pixel intensity of an image in Matlab is by using the imadjust
function. This function maps the intensity values of an image to a new range of values specified by the user.
Here's an example code that normalizes the pixel intensity of an image:
main.m317 chars15 lines
In this example, imread
is used to read the image from a file. Then, imadjust
is used to normalize the pixel intensity values of the image. The [0.0, 1.0]
range specifies that the minimum and maximum intensity values in the input image will be mapped to the minimum and maximum intensity values of the output image, respectively. The resulting normalized image is displayed using imshow
.
Note that normalization can also be done by subtracting the mean of the pixel intensity values and dividing by the standard deviation, or using other techniques such as histogram equalization.
gistlibby LogSnag