开发者

Show camera inputs at different axes - MATLAB

I have 3 web cameras and 3 axes in MATLAB's GUI. How can I place webcaminput1 to a开发者_JS百科xes1, webcaminput2 to axes2 and webcaminput3 to axes3 ?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜