Created
January 3, 2020 09:07
-
-
Save ritwikraha/c0871fe265e6879ec3e7252e0f783aa4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grayImage = imread('cameraman.tif'); | |
subplot(2, 1, 1); | |
imshow(grayImage); | |
subplot(2, 1, 2); | |
histObject = histogram(grayImage, 256, 'Normalization', 'probability') | |
grid on; | |
xlabel('Gray Level', 'FontSize', 20); | |
ylabel('Probability', 'FontSize', 20); | |
% Extract probabililty of each gray level into a vector "p". | |
p = histObject.Values; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment