vision.videoplayer fit to window

조회 수: 8 (최근 30일)
nedonatelli
nedonatelli 2016년 8월 9일
답변: Adrian Bell 2019년 7월 25일
The images I pass into the vision.videoplayer object are much larger than the object itself. I find it frustrating to manually select fit to window when I process many videos in a row at varying image sizes. Is there any way to programmatically fit the video to the video player object? The documentation on this toolbox is very skimpy at best and I find it surprising the object only has two properties listed:
not to mention most of the methods actually seem quite useless...
Before it is mentioned: I am specifically looking for an option with the vision.videoplayer object. I have the capability of making my own UI that can play the video at the correct fit but I do not wish to take this route for simplicity's sake.

답변 (2개)

Swarooph
Swarooph 2016년 8월 9일
Have you tried playing with the Position property of the object? This can change the size of the VideoPlayer's window using a parameter of the form [left bottom width height].
  댓글 수: 1
nedonatelli
nedonatelli 2016년 8월 9일
I have tried this already, this only applies to the figure the object is placed in, not to the images the object runs. I'll include the link again: http://www.mathworks.com/help/vision/ref/vision.videoplayer-class.html
along with the quote that explains the position property:
"Specify the size and position of the video player window in pixels as a four-element vector of the form: [left bottom width height]. This property is tunable."

댓글을 달려면 로그인하십시오.


Adrian Bell
Adrian Bell 2019년 7월 25일
Basically, you use figure handles on the player object to automatically press the "Maintain fit to window" button for you.
set(0,'showHiddenHandles','on')
fig_handle = gcf ;
fig_handle.findobj % to view all the linked objects with the vision.VideoPlayer
ftw = fig_handle.findobj ('TooltipString', 'Maintain fit to window'); % this will search the object in the figure which has the respective 'TooltipString' parameter.
ftw.ClickedCallback() % execute the callback linked with this object

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by