Preview in MATLAB GUI
24 ビュー (過去 30 日間)
古いコメントを表示
Hello, so I am creating a GUI where I want to have a preview of a video, but without it opening up in another window. Is that possible? preview() opens another window, and I tried to experiment with imshow, but I'm not sure on how to really do this. My computer is attached to a camera device and I already have that setup. Thank you!
0 件のコメント
採用された回答
Kevin Holly
2022 年 8 月 19 日
You can use the command:
preview(vid, hImage);
where hImage is the handle to the image object in which the data is to be displayed.
How are you creating your UI? Are you using App Designer?
3 件のコメント
Walter Roberson
2023 年 2 月 8 日
You do not pass in an axes handle for the second parameter of preview(): you pass in the handle an image() object. For example,
ax = app.UIAxes2;
z = zeros(640,480,3);
hImage = image(z);
preview(vid, hImage);
It turns out to be possible for vid to be a vector of videoinput() results; in that case, hImage would have to be a row vector of image() objects the same length as vid is. This is something that would be used if you were previewing several video input devices simultaneously.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!