1

このコードは 2 行のライブ ビデオを取得することになっていますが、コードを実行すると、カムはライブ ビデオを取得しますが、2 行が別のウィンドウに表示されます。誰でも何が問題なのか理解できますか?

clear;


dev_info = imaqhwinfo('winvideo',1);
celldisp(dev_info.SupportedFormats);
vid1 = videoinput('winvideo',1);


%out = imaqhwinfo(vid);

%This is for triggering:


num_frames=5;

triggerconfig(vid1, 'Manual')
set(vid1,'FramesPerTrigger',num_frames)

start(vid1);
trigger(vid1)

%frame = getsnapshot(vid1);
%image(frame);

%here it will acquire 5 frames



%now move the data acquired to the workspace
[data1 time1] = getdata(vid1,num_frames);
kk=length(time1);
elapsed_time = time1(kk) - time1(1);
%frame = getsnapshot(vid1);   %this is to get a single frame
for i=1:500

line([27,1523],[1753,1753]);
line([7,1531],[1395,1395]);
 preview(vid1);
end



delete(vid1);
clear vid1;


aviobj = avifile('example.avi');
for i=1:kk
    F=data1(:,:,:,i);
    aviobj = addframe(aviobj,F);
end
aviobj = close(aviobj);

%then we can see the whole video clip
mov = mmreader('example.avi');

%................

%Also, we can directly play the video from the video file
mplay('example.avi');
4

0 に答える 0