Zorbing

[Medtec] imageContrast.m

Jul 9th, 2013
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.34 KB | None | 0 0
  1. %% Bildkontrast
  2. % 3.
  3. function contrast = imageContrast(image)
  4.     % 3.a)
  5.     image = image(:);
  6.    
  7.     % 3.b)
  8.     image = double(image);
  9.    
  10.     % 3.c)
  11.     meanGreyValue = sum(image) / numel(image);
  12.    
  13.     % 3.d)
  14.     contrast = sum(image .* image) / numel(image);
  15.     contrast = contrast - (meanGreyValue * meanGreyValue);
  16. end
Advertisement
Add Comment
Please, Sign In to add comment