tags:

views:

136

answers:

1

I have 3 web cameras and 3 axes in MATLAB's GUI. How can I place webcaminput1 to axes1, webcaminput2 to axes2 and webcaminput3 to axes3 ?

A: 

It would be helpful if you give more details on how you get input from webcam and display it on the screen.

I assume you are using Image Acquisition Toolbox. The usual code to display webcam input is

vid = videoinput('winvideo');
preview(vid)

PREVIEW also can accept image object handle as a second parameter. So you can create image object first and use its axis for preview:

vid1 = videoinput('winvideo',1); % create video input object from the 1st source
vid2 = videoinput('winvideo',2); % create video input object from the 2nd source
subplot(211)
h1 = image; % create image object
axis ij % flip the image
preview(vid1,h1) % display 1st webcam preview
subplot(212) % same for the 2nd camera
h2 = image;
axis ij
preview(vid2,h2)

I don't have multiple webcams, so I didn't test this code, but I hope it will work for multiple cameras.

yuk
Thanks for your help. I tested this code and worked smooth.
suphero