Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. vid=videoinput('winvideo');
  2. preview(vid)
  3. for i=1:10
  4. obraz=getsnapshot(vid);
  5. obraz_sz=rgb2gray(obraz);
  6. figure(2);
  7. subplot(2,2,1);
  8. imshow(obraz_sz);
  9. title('Obraz szary');
  10. subplot(2,2,2); imhist(obraz_sz);
  11. title('Histogram');
  12. obraz_wh=histeq(obraz_sz);
  13. subplot(2,2,3); imshow(obraz_wh);
  14. title('Wyrownanie histogramu');
  15. subplot(2,2,4); imhist(obraz_wh);
  16. title('Histogram po wyr.');
  17. prog=graythresh(obraz_sz);
  18. obraz_czb=im2bw(obraz_sz,prog);
  19. moj_prog = 0.8
  20. figure(3);
  21. obraz_czb_m=im2bw(obraz_sz, moj_prog)
  22. subplot(1,2,1); imshow(obraz_czb); title(prog)
  23. subplot(1,2,2); imshow(obraz_czb_m); title(moj_prog)
  24. end
  25. close all
  26. delete(vid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement