Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. vid = videoinput('winvideo');
  2. %preview(vid);
  3. %obr_rgb=getsnapshot(vid);
  4. %figure(2); imshow(obr_rgb)
  5. set(vid, 'TriggerRepeat', Inf);
  6. start(vid)
  7. for i=1:300,
  8. obr_rgb=getdata(vid,1);
  9. %figure(2),imshow(obr_rgb);
  10. obr_sz=rgb2gray(obr_rgb);
  11. %figure(3),imshow(obr_sz);
  12. figure(2)
  13. subplot(2,2,1);
  14. imshow(obr_sz)
  15. subplot(2,2,2);
  16. imhist(obr_sz)
  17. obr_wh=histeq(obr_sz);
  18. subplot(2,2,3);
  19. imshow(obr_wh)
  20. subplot(2,2,4);
  21. imhist(obr_wh)
  22. prog=graythresh(obr_sz);
  23. obr_cz=im2bw(obr_sz,prog);
  24. figure(3)
  25. imshow(obr_cz)
  26. end
  27. stop(vid)
  28. %close(gcf)
  29. %clear
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement