Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function compute_histogram = compute_histogram(image)
- M = size(image,1);
- N = size(image, 2);
- compute_histogram = zeros([256, 1]);
- for i = 1:M
- for j = 1:N
- k = image(i,j);
- compute_histogram(k+1)= compute_histogram(k+1) + 1;
- end
- end
- compute_histogram = compute_histogram / (M*N);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement