Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8217809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:34:37+00:00 2026-06-07T12:34:37+00:00

I have written a matlab project that takes a video as an input, cuts

  • 0

I have written a matlab project that takes a video as an input, cuts it into frames, and shows the frames to the user one by one, giving him the ability to make changes to each frame.

I want to add a “side bar”, that shows a particular frame to the user, as well as buttons for GUI frames from 1 to 10, when he can press on “->” or “<-” to move to prev\next 10 frames, and can click on a frame to show it in a larger size.

Something like this:

   This is the GUI:
.__________________________________.
|                                  | 
|          Frame No. i             | 
|                                  | 
|--------------------------------- | 
|<-| Frame j|j+1|.....|Frame j+9|->| 
|__________________________________|

I thought about using “subplot” but didn’t know how to add the ability to show\update prev\next frames on clicking.

Another implementation is something like this:

% The Main Image:
   hAx = axes('Position',[0 0.3 1 0.8], 'Parent',hFig);
   hMainImg = imshow(img, 'Parent',hAx);

% the slider
hPanel = uipanel('Position',[0 0.04 1 0.26], 'Parent',hFig);
uicontrol('Style','slider', 'Parent',hFig, ...
    'Callback',@slider_callback, ...
    'Units','normalized', 'Position',[0 0 1 0.04], ...
    'Value',1, 'Min',1, 'Max',mx, 'SliderStep',[1 10]./mx);

But then, what about the slider?

Any ideas how can I implement this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:34:38+00:00Added an answer on June 7, 2026 at 12:34 pm

    Here is a working example. We open a small video file, and reads all its 141 frames. You can browse through them using the slider, click any small image to display it in the main axis.

    function framesBrowserDemo()
        %# read all frames at once
        vid = VideoReader('xylophone.mpg');
        numImgs = get(vid, 'NumberOfFrames');
        frames = read(vid);
        clear vid
    
        %# design GUI
        numThumbs = 5;
        mx = numImgs-numThumbs+1;
        hFig = figure('Menubar','none');
        hPanel = uipanel('Position',[0 0.04 1 0.16], 'Parent',hFig);
        uicontrol('Style','slider', 'Parent',hFig, ...
            'Callback',@slider_callback, ...
            'Units','normalized', 'Position',[0 0 1 0.04], ...
            'Value',1, 'Min',1, 'Max',mx, 'SliderStep',[1 10]./mx);
    
        %# main axis, and show first frame
        hAx = axes('Position',[0 0.2 1 0.8], 'Parent',hFig);
        hMainImg = imshow(frames(:,:,:,1), 'Parent',hAx);
    
        %# thumbnail axes
        hThumImg = zeros(numThumbs,1);
        for i=1:numThumbs
            %# create axis, show frame, hookup click callback
            hAx = axes('Parent',hPanel, ...
                'Position',[(i-1)/numThumbs 0 1/numThumbs 1]);
            hThumImg(i) = imshow(frames(:,:,:,i), 'Parent',hAx);
            set(hThumImg(i), 'ButtonDownFcn',@click_callback)
            axis(hAx, 'normal')
        end
    
        %# callback functions
        function slider_callback(src,~)
            val = round(get(src,'Value'));  %# starting index
            %# update the thumbnails
            for k=1:numel(hThumImg)
                set(hThumImg(k), 'CData',frames(:,:,:,k+val-1))
                drawnow
            end
        end
    
        function click_callback(src,~)
            %# update the main image
            set(hMainImg, 'CData',get(src,'CData'));
            drawnow
        end
    end
    

    screenshot

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a written a MATLAB program that creates custom MATLAB functions on the
I have a series of experiments that were written for MATLAB, but recently we
I have written some matlab code for image analysis that searches for clusters in
I have some programs written in Matlab that I need to run several times
I have written the following algorithm in order to evaluate a function in MatLab
I'm trying to rewrite code I've written in matlab in C++ instead. I have
I have written a function that sorts a big scale of data. To test
I have written a function that extract the domain from hostname. e.g. www.domain.com ->
I have written a set of Matlab functions and I want to distribute it
I have a matlab function written in an m-file. (it's not written by me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.