Advertisement
makispaiktis

1. Image - Contrast histogram and equalization

Apr 18th, 2022 (edited)
926
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.58 KB | None | 0 0
  1. clc
  2. clear all
  3.  
  4. % 1a. Image1 read
  5. I = imread('littlegirl.png');
  6. whos I
  7. % 1b. Image1 show and histogram
  8. figure(1);
  9. imshow(I);
  10. figure(2);
  11. imhist(I);
  12. display('Low contrast image: he intensity range of the image is rather narrow. The range does not cover the potential range of [0, 255], and is missing the high and low values that would result in good contrast.');
  13.  
  14. % 2a. Image2 creation - Contrast enhancement
  15. % HISTOGRAM EQUALIZATION
  16. I2 = histeq(I);
  17. whos I2
  18. % 2b. Image1 show and histogram
  19. figure(3);
  20. imshow(I2);
  21. figure(4);
  22. imhist(I2);
  23. display('High contrast image');
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement