Contrast stretching diagram formula with imadjust function in matlab

조회 수: 11 (최근 30일)
Nayuta Altria
Nayuta Altria 2020년 1월 23일
댓글: Ali Abdullah 2020년 10월 22일
Help me.... I have an image output contrast stretching use function "imadjust"
How i can see a diagram like bellow with my image contrast stretching...?

답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 1월 23일
편집: KALYAN ACHARJYA 2020년 1월 23일
  1. Suppose you have input image, say input_image
  2. Do the some gray lebel operation, say the result is output_image;
Here when apply the transfer function, pixel values will be changed, right,
Say Pixel Values in input image After transfer function Pixel Values in output image
0 2
1 5
.................................
255 255
Now plot the cloumn1 vs cloumn 2 in above example. The plot in nothing about the image, its how you replace the invividual pixel value using some maths equation right (Transfer Function)
Let see the an example, transfer function is log(r), r represent the pixel values in input image
input_pixels=0:255;
output_pixels=log(input_pixels)
%% Plot
plot(input_pixels,output_pixels);
xlabel('Input Intensity Levels');
ylabel('Output Intensity Levels');
xlim([0,255])
99.png
In the plot, you have shown of contrast stretching having three relations between input vs output
First Segment-
Second Segment-
Third Segment-
Hope it helps!, Any questions are welcome
  댓글 수: 2
Nayuta Altria
Nayuta Altria 2020년 1월 23일
Hmm.. Actualy i want get diagram in contrast stretching formula with output images use function "imadjust"...
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 1월 23일
편집: KALYAN ACHARJYA 2020년 1월 23일
input_im=rgb2gray(imread('2.png'));
input_pix_value=unique(input_im(:));
output_pix_value=10+imadjust(input_pix_value,[0.3 0.7],[]);
plot(input_pix_value,output_pix_value,'linewidth',3);
xlabel('Input Intensity Levels');
ylabel('Output Intensity Levels');
xlim([0,255]),ylim([0,255]);
Dp change the transformation function and get the required shape, I added the extra 10 in each pixels

댓글을 달려면 로그인하십시오.


Ali Abdullah
Ali Abdullah 2020년 10월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by