Advertisement
tarektalaat

Untitled

Jan 30th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. Image Image :: increasecontrast ()
  2. {
  3. int min_value=255;
  4. int max_value=0;
  5.  
  6. for (int i=0 ; i < height ; i++)
  7.  
  8. for (int j=0 ; j < width ; j++)
  9. {
  10.  
  11. if (image [i][j] < min_value)
  12. min_value = image[i][j];
  13. else
  14. min_value=min_value
  15. if (image [i][j]> max_value)
  16. max_value =image [i][j];
  17. else
  18. max_value = max_value
  19. }
  20.  
  21. double m = 255.0 / (max_value - min_value);
  22. double c= -m * min_value;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement