Combine slider and video in appdesigner
Show older comments
In appDesigner I am trying to use the changingSlider callback to move between frames in a video.
My code has a RunAnalysisButtonPushed function that processes a video and adds markers to frames, saving each frame in the property
app.outVid(:,:,:,nFrame)=processedVideoFrame;
within a while loop. This function also starts the video player on specific axis in the UI as
imshow(vidIn, 'Parent', app.VideoDisplayer);
where vidIn is the very first frame shown within said funtion.
A second function TimeSliderValueChanging aims at displaying the frame as the slider is moved by
video_updater(app,round(event.Value))
function video_updater(app,nFrame)
imshow(app.out(:,:,:,nFrame), 'Parent',app.VideoDisplayer);
end
The code works as inteded althought the image displayed is as follows:

I don't understand why the colours are not displayed properly.
What I have tried and did NOT work:
- I have run the engine of this code in matlab (not in appdesigner) and the procedure of saving the modified frames with the method outVId(:,:,:,nFrame) shown above does not modify colors when played back in a for cycle with a figure and imshow, therefore I exclude that the method of saving the frames is at fault.
- I have displayed the frames within RunAnalysisButtonPushed as they were being calculated and WITHOUT saving them in app.outVid but within a temporary variable internal to the function RunAnalysisButtonPushed and colors are diplayed correctly
It seems to me that the problem lies within trying to store the frames in the app property app.outVid
What could be the cause of this? And how can I work around it?
Thank you
Answers (0)
Categories
Find more on Computer Vision Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!