i want to take a video from my code but it creates lots of frame, can anyone help me?

if true
%%%%%
vid = videoinput('winvideo', 1, 'YUY2_640x480'); set(vid, 'FramesPerTrigger', Inf); set(vid, 'ReturnedColorspace', 'rgb') vid.FrameGrabInterval =5; start(vid) while(vid.FramesAcquired<=50) img_orig = getsnapshot(vid);
height = size(img_orig,1); width = size(img_orig,2);
%Initialize the output images out = img_orig; bin = zeros(height,width);
%Convert the image from RGB to YCbCr img_ycbcr = rgb2ycbcr(img_orig); Cb = img_ycbcr(:,:,2); Cr = img_ycbcr(:,:,3);
%Detect Skin [r,c,v] = find(Cb>=77 & Cb<=127 & Cr>=133 & Cr<=173); numind = size(r,1);
%Mark Skin Pixels for i=1:numind out(r(i),c(i),:) = [0 0 255]; bin(r(i),c(i)) = 1; end figure; imshow(bin); end stop(vid); flushdata(vid); clear all end

2 件のコメント

Image Analyst
Image Analyst 2014 年 3 月 8 日
I don't understand the question. Can you be more specific? "I want to take a video" implies that you want to extract a new video from the existing video. However you you said that "it creates lots of frames" which implies you want few or maybe only 1 frame. So do you want to create a new video, or just save one frame from the video into a new disk file?
YUNUS
YUNUS 2014 年 3 月 8 日
when i run this code, it gives pictures,but i want only video. sorry for my bad english

サインインしてコメントする。

 採用された回答

YUNUS
YUNUS 2014 年 3 月 9 日

0 投票

thanks for your help, i solved this problem

1 件のコメント

Image Analyst
Image Analyst 2014 年 3 月 9 日
編集済み: Image Analyst 2014 年 3 月 9 日
Usually you accept the answer of the person who helped you, not your own "thanks" comment.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2014 年 3 月 8 日

0 投票

The second half of the attached demo shows how you can build a video from a series of frames or files on disk.

2 件のコメント

YUNUS
YUNUS 2014 年 3 月 8 日
i didn't see starting point :(
That would be about half way down where you see the comments:
% Ask user if they want to read the individual frames from the disk,
% that they just wrote out, back into a movie and display it.

サインインしてコメントする。

質問済み:

2014 年 3 月 8 日

編集済み:

2014 年 3 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by