Advertisement
Eeedi

Wizja lab2

Oct 27th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.48 KB | None | 0 0
  1. info=imaqhwinfo
  2. vid=videoinput('winvideo')
  3. %preview(vid)
  4. get(vid)
  5. get(getselectedsource(vid))
  6. set(vid, 'TriggerRepeat', Inf)
  7. set(gcf, 'doublebuffer', 'on')
  8. start(vid)
  9. while(vid.FramesAcquired <=10)
  10.     data=getsnapshot(vid);
  11.     obraz=rgb2gray(data);
  12.     figure(1);
  13.     imshow(obraz);
  14.    
  15. end
  16. figure(2);
  17.  imhist(obraz);
  18.  figure(3);
  19.  histeq(obraz);
  20.  level=graythresh(obraz);
  21.  bin=im2bw(obraz,level);
  22.  figure(4);
  23.  imshow(bin);
  24. stop(vid)
  25. delete(vid)
  26. clear
  27.  
  28. close(gfc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement