pabloducato

Leno_Paleno

Oct 22nd, 2018
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.67 KB | None | 0 0
  1. clear all;
  2.  
  3. vid=videoinput('winvideo') %obiekt kamerki
  4. preview(vid) %podglad z kamery
  5. for i=1:500
  6.     obraz=getsnapshot(vid);
  7.    
  8.     figure(2);
  9.    
  10.     obraz_sz=rgb2gray(obraz);
  11.     subplot(3,2,1);;imshow(obraz_sz);title('szary')
  12.     subplot(3,2,2);imhist(obraz_sz);title('histogram')
  13.    
  14.    
  15.     obraz_wh=histeq(obraz_sz);
  16.     subplot(3,2,3);imshow(obraz_wh);title('wyrownanie histogramu')
  17.     subplot(3,2,4);imhist(obraz_wh);title('hist. wyr')
  18.    
  19.     prog=graythresh(obraz_sz);
  20.     obraz_czb=im2bw(obraz_sz,prog);
  21.     subplot(3,2,5);imshow(obraz_czb);title('czarno & bialu');
  22.     subplot(3,2,6);imhist(obraz_czb);title('hist. czarno & bialu')
  23.    
  24. end
Add Comment
Please, Sign In to add comment