Ask an expert. Trust the answer.

Your academic and career questions answered by verified experts

GUI in MATLAB for video

Date: 2022-12-21 12:53:04

I have a video of about 200 frames. I want to capture every 10th frame, do some image processing on it and display the original image along with the plot (after my image processing steps). The output should be first the 10th frame and its plot, and only after i click a push button should it move on and do the processing on the 20th frame, display it and so on. Once i get the desired frame for eg. 180th frame, i want to display the total time elapsed to reach that frame (if frame rate is 10 frames/sec then it should display 18 sec).

Till now i was dealing with separate frames and doing image processing on them and manually calculating the results. But a GUI would make this process more efficient 

Answers: 

Neat problem. Here's what you can do:

  1. At program startup, use dir, (like this: filelist = dir('*.bmp')) to get a list of all of the image files in the folder in which you are working.
  2. Assign that list to the guidata handles, like so: handles.filelist = filelist. While your at it, add another handle value to hold your current image index, handles.frameindex = 1, you'll need this later. Don't forget to update guidata afterwards!
  3. In the pressed callback function of your pushbutton, do something like this:

    filelist = handles.filelist; frameindex = handles.frameindex; currentframefile = filelist(frameindex); handles.frameindex = frameindex+1;

  4. Use the currentframefile, which is a string containing the name of the current frame, with your existing GUI.

This should answer your question, if I understand it correctly. Let me know if you need clarification. Good Luck!


Why Matlabhelpers ?

Our Matlab assignment helpers for online MATLAB assignment help service take utmost care of your assignments by keeping the codes simple yet of high-quality. We offer the most reliable MATLAB solutions to students pursuing their Computer Science course from the Monash University, the University of Sydney, the University of New South Wales, the University of Melbourne; to name a few. Approach us today for best Matlab solutions online!

whatsApp order on matlabhelpers.com

telegram order on matlabsolutions.com