Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vid=videoinput('winvideo');
- preview(vid)
- for i=1:10
- obraz=getsnapshot(vid);
- obraz_sz=rgb2gray(obraz);
- figure(2);
- subplot(2,2,1);
- imshow(obraz_sz);
- title('Obraz szary');
- subplot(2,2,2); imhist(obraz_sz);
- title('Histogram');
- obraz_wh=histeq(obraz_sz);
- subplot(2,2,3); imshow(obraz_wh);
- title('Wyrownanie histogramu');
- subplot(2,2,4); imhist(obraz_wh);
- title('Histogram po wyr.');
- prog=graythresh(obraz_sz);
- obraz_czb=im2bw(obraz_sz,prog);
- moj_prog = 0.8
- figure(3);
- obraz_czb_m=im2bw(obraz_sz, moj_prog)
- subplot(1,2,1); imshow(obraz_czb); title(prog)
- subplot(1,2,2); imshow(obraz_czb_m); title(moj_prog)
- end
- close all
- delete(vid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement