How can I continually update the UI Axes in App Designer to display images from a CMOS camera?

6 ビュー (過去 30 日間)
I would like to create a video feed in the UI Axes in App Designer. At the moment, I am updating the CData of the figure, though I am having large lag times. The code that I am using runs quickly--in about 100ms--but the image on the UI Axes updates approximately every two seconds. Preferably, the video feed would run parallel so that I can also interact with my GUI simultaneously. Is there a way to use the UI Axes to run this type of figure?
  3 件のコメント
Cody LaBelle
Cody LaBelle 2017 年 9 月 15 日
編集済み: Cody LaBelle 2017 年 9 月 15 日
I have used the drawnow function to update the axes, though it did not reduce the updating time. Also, I updated MATLAB to 2017b (pre-release) due to the fact that the drawnow functionality was added to the UI axes in 2017a. Unfortunately this did not help.
As a temporary work around, I am using an external figure to display my video feed, which runs very quickly.
Sarah Mohamed
Sarah Mohamed 2017 年 9 月 15 日
I see, thanks for trying that out. Could you share the code you are using to update the UIAxes?

サインインしてコメントする。

回答 (1 件)

karim botros
karim botros 2018 年 3 月 7 日
編集済み: karim botros 2022 年 1 月 24 日
it works in app designer
you can use global var if you want to use the object camera in another function
global cam
im=image(zeros(340,340,3),'Parent',app.UIAxes);
preview(cam,im);
setappdata(app.UIAxes, 'cam', cam);
  2 件のコメント
Ahmer Shahid
Ahmer Shahid 2018 年 11 月 13 日
I cannot get the camera on axis by this code.
karim botros
karim botros 2022 年 1 月 26 日
make sure that the camera is connected to matlab

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by