Webカメラの映像を​uitab上に表示す​るにはどうすればよい​ですか?

13 views (last 30 days)
koji fukumoto
koji fukumoto on 11 Oct 2018
Edited: Kojiro Saito on 12 Oct 2018
ウインドウ上に複数のタブを作成し、そのうちの一つを「Webカメラの映像専用タブ」にしたいです。
cam = webcam(1);
preview(cam);
で表示されるプレビューウインドウの内容を、タブ上に表示するイメージです。
タブの作成まではできております。 空のタブ上に映像を表示させる方法を教えてください。
よろしくお願いします。

Accepted Answer

Kojiro Saito
Kojiro Saito on 12 Oct 2018
Edited: Kojiro Saito on 12 Oct 2018
uitabの中にuiaxesを作成し、その中にWebCamの画像を表示させる、という方法で実現できます。
f = uifigure;
tabgp = uitabgroup(f,'Position',[10 10 500 400]);
tab1 = uitab(tabgp,'Title','Tab1');
tab2 = uitab(tabgp,'Title','WebCam');
ax = uiaxes(tab2);
cam = webcam(1);
frame = snapshot(cam);
im = image(ax, zeros(size(frame), 'uint8'));
axis(ax,'image');
% WebCamの映像を表示
preview(cam, im)
WebCamタブに画像が表示されます。

More Answers (0)

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!