imadjust
imadjust is a computer function that adjusts the brightness of a grayscale image or the color matrix of a color image. Type doc imadjust or help imadjust in the Matlab command window to get help for this function, and type imadjust to see the source code for the function.
Function Functions:
imadjust is used in digital image processing to perform grayscale transformations (adjusting the brightness of a grayscale image or the color matrix of a color image). Type doc imadjust or help imadjust in the Matlab command window to get help for the function, and type imadjust to see the source code for the function.
Format:
g = imadjust(f,[low_in; high_in],[low_out; high_out]) Maps the luminance value in image I to the new value in J. That is, the values between low_in and high_in are mapped to the values between low_out and high_out. Values below low_in and above high_in are clipped, i.e., those below low_in are mapped as low_in and those above high_in are mapped as high_in. Both [low_in; high_in] and [low_out; high_out] can be represented using the empty matrix, which defaults to [0,1] All parameters except f are between 0 and 1. If high_out<low_out, the output gray scale will be inverted.
f = imread('C:\Users\win\Desktop\'); %Adjusting the gray scale range of a grayscale image g = imadjust(f,[0.2;0.6],[0;1]); figure(1); subplot(1,2,1);imshow(f);title('Original image'); subplot(1,2,2);imshow(g);title('Adjusting the grayscale of the graph')
The original image has a grayscale range of 0 to 255. imadjust sets values less than 0.2x255 to 0 and values greater than 0.6x255 to 255.
stretchlim()
Calculate the optimal input interval for the grayscale image.
Use stretchlim() and imadjust() together to adjust the gray scale range of a grayscale image.
f = imread('C:\Users\win\Desktop\'); s = stretchlim(f);%Calculate the optimal input interval for the grayscale image g = imadjust(f,s,[0,1]);%Adjusting the gray scale range of a grayscale image figure(1); subplot(1,2,1);imshow(f);title('Original image'); subplot(1,2,2);imshow(g);title('Adjusting the grayscale of the graph')
g = imadjust(f,[low_in; high_in],[low_out; high_out],gamma) Maps the luminance value in image I to a new value in J. The value in J is the value in the image I. where gamma specifies the shape of the curve describing the relationship between value f and value g. If gamma is less than 1, this mapping favors higher values (bright) output; if gamma is greater than 1, this mapping favors lower values (grayish) output; the default gamma is 1 (linear mapping).
f = imread('C:\Users\win\Desktop\'); s = stretchlim(f);%Calculate the optimal input interval for the grayscale image g = imadjust(f,s,[0,1],0.6);%Adjusting the gray scale range of a grayscale image h = imadjust(f,s,[0,1],6); figure(1); subplot(1,3,1);imshow(f);title('Original image'); subplot(1,3,2);imshow(g);title('gamma = 0.6') subplot(1,3,3);imshow(h);title('gamma = 6');
RGB2 = imadjust(RGB1,…) The red, green, and blue color palettes of the RGB image RGB1 are adjusted separately. As the color matrix is adjusted, each palette has a unique mapping value.
f = imread('C:\Users\win\Desktop\'); g = imadjust(f,[0.2 0.3 0.1;0.6 0.8 0.9],[],0.6);%imadjusttreat (sb a certain way)RGBImage processing figure(1); subplot(1,2,1);imshow(f);title('Original image'); subplot(1,2,2);imshow(g);title('Processed images')
Knowledge Points Supplement:
MATLAB imadjust function understanding
J = imadjust(I,[LOW_IN; HIGH_IN],[LOW_OUT; HIGH_OUT]) [LOW_IN; HIGH_IN] controls the range of pixel values in the original image I to be displayed in J. LOW_IN denotes the minimum value of pixel values to be displayed in I. HIGH_IN denotes the maximum value of pixel values to be displayed in I. [LOW_OUT; HIGH_OUT] denotes the maximum value of pixel values to be displayed in J. [LOW_OUT; HIGH_OUT] indicates the range of pixel values to be displayed in J. OUT; HIGH_OUT] indicates the range of pixel values in J
An example:
J = imadjust(I,[0.3 0.8],[0.2 0.9]): indicates that I is displayed in J with pixel values ranging from 0.3 to 0.8, and that 0.3 corresponds to 0.2 in J, and 0.8 corresponds to 0.9 in J. All pixels in I that are less than 0.3 are represented by 0.2 in J, and all pixels that are higher than 0.8 are represented by 0.9. J = imadjust(I,[LOW_IN; HIGH_IN],[LOW_OUT; HIGH_OUT],GAMMA) GAMMA specifies the shape of the curve that describes the relationship between I and J. A GAMMA less than 1 means that the value of I becomes larger than the original value when mapped to J, and a GAMMA greater than 1 means that the value of I is smaller when mapped.
summarize
To this article on matlab - imadjust function of the article is introduced to this, more related matlab - imadjust function content please search for my previous articles or continue to browse the following related articles hope that I hope you will support me more in the future!