superimposes realitime web cam stream
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
I have a webcam stream in a GUI, what I need to do is have two webcams in this one preview window in the GUI superimposed on eachother in real time. I have this following code which refreshes a figure window with images on top of eachother.
clear all
close all
clc;
vid = videoinput('winvideo',1, 'YUY2_640x480');
vid1 = videoinput('winvideo',2, 'YUY2_640x480');
% to convert to rgb colors
vid.ReturnedColorSpace = 'rgb';
vid1.ReturnedColorSpace = 'rgb';
set(vid,'FramesPerTrigger',1);
set(vid1,'FramesPerTrigger',1);
while (1)
start(vid);
start(vid1);
%retrieves all the frames acquired at the last trigger
data = getdata(vid);
data1 = getdata(vid1);
%to display them in one video
result=data+data1;
imshow(result);
drawnow;
end
stop(vid),delete(vid),clear vid;
Can anyone help me to do this in a preview in real time?
Thanks alot.
0 件のコメント
回答 (1 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!