Advertisement
purxiz

Untitled

Oct 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.35 KB | None | 0 0
  1. function compute_histogram = compute_histogram(image)
  2.     M = size(image,1);
  3.     N = size(image, 2);
  4.     compute_histogram = zeros([256, 1]);
  5.     for i = 1:M
  6.         for j = 1:N
  7.             k = image(i,j);
  8.             compute_histogram(k+1)= compute_histogram(k+1) + 1;
  9.         end
  10.     end
  11.     compute_histogram = compute_histogram / (M*N);
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement