简体   繁体   English

想在app app matlab中显示第一帧视频

[英]Want to display first frame of video in app designer matlab

I am trying to show the first frame of a video on a GUI in app designer. 我试图在应用程序设计器的GUI上显示视频的第一帧。 So far, everything seems to process, and I am not receiving any errors, but the image I want is not showing. 到目前为止,一切似乎都在处理,我没有收到任何错误,但我想要的图像没有显示。 All I get is the UIAxes disappears, and nothing shows up. 我得到的只是UIAxes消失了,没有任何东西出现。 When I copy this code and run it outside of app designer it runs fine, it just won't display the image I need in the GUI. 当我复制此代码并在应用程序设计器之外运​​行它运行正常时,它只是不会在GUI中显示我需要的图像。

x= app.DirEditField.Value % app.DirEditField.Value is the video filename
obj=VideoReader(x); 
vid=read(obj); 
firstframe=read(obj,1); 
imshow(firstframe,'Parent',app.UIAxes);

弄清楚,我确实删除了UIAxes对象并放入一个新对象,它完美地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM