Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vid = videoinput('winvideo')
- get(vid)
- get(getselectedsource(vid))
- set(vid, 'TriggerRepeat', Inf)
- figure;
- set(gcf, 'doublebuffer', 'on')
- start(vid)
- flushdata(vid);
- while (vid.FramesAcquired <= 100)
- data = getdata(vid, 1);
- image = rgb2gray(data);
- subplot(3,2,1)
- imshow(image)
- subplot(3,2,2) %histogram szarego
- imhist(image)
- leveledImage = histeq(image)
- subplot(3,2,3)
- imshow(leveledImage)
- threshold = graythresh(image) % binaryacja adaptacyjne
- binaryImage = im2bw(image, threshold)
- subplot(3,2,4)
- imshow(binaryImage)
- end
- stop(vid)
- delete(vid)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement