Doug's MATLAB Video Tutorials

January 18th, 2008

Cool Feature: Video processing demos

Thank you to everyone that answered the survey from my last post. I will be processing the results and reporting in my next post. Changes are already being planned based on the results. This three minute video shows you how to view product demos in the Video and Image Processing blockset. Motion detection and tracking is covered in the first demo and photo mosaicking from video is covered in the second.
Find the files here. PodCast here Other videos have been gathered here: http://blogs.mathworks.com/pick/category/video/ Other cool feature posts have been gathered here: http://blogs.mathworks.com/pick/category/cool-feature/

21 Responses to “Cool Feature: Video processing demos”

  1. Szymon Gackowski replied on :

    ok, that is really cool. But is there any possibility to do this in real time using data aquisition? how to aquire data from usb web cam?
    best regards!
    Simon

  2. Bruce Tannenbaum replied on :

    Hi Szymon,

    With the Image Acquisition Toolbox, you can acquire images or video into Simulink and/or MATLAB. For Simulink, you would use the “From Video Device” block. This supports USB web cameras, as well as a broad range of frame grabbers and scientific digital cameras. For more information on the supported hardware, look here: http://www.mathworks.com/products/imaq/supportedio.html

    - Bruce

  3. Szymon Gackowski replied on :

    Thank you Bruce!
    That was very helpful!

  4. elya replied on :

    hi,i’m using MATLAB 7.0.

    i’m a beginner. I want to read/call video (.avi) file in MATLAB but i couldn’t find any function. how to call the video (.avi) in matlab? how to extract the video frame by frame?

    thanks

  5. Scott Hirsch replied on :

    Elya -

    In v7.0, try aviread. This has straightforward syntax for reading a single frame – you could just embed in a for loop if that’s appropriate.

    Readers with newer versions should check out mmreader – introduced on Windows in R2007b, Mac in R2008a.

    - scott

  6. jhon diaz replied on :

    Hi.
    I’m a beginer in Matlab and since three months ago I started working with video files. With the image processing toolbox and image acquisition toolbox I can select my frames and process some analysis, however I’m planning to execute an event depending on what happens in the video (tracking objects). This event is to output a signal for triggering an external device. Could someone give me an idea of how to do this? Thanks a lot.

  7. dhull replied on :

    jhon,

    I think you need to be more specific with your question.

    What do you mean by “executing an event” This makes me think of either callbacks or Simulink/Stateflow.

    You want this event to trigger and external device. Do you know how to trigger the external advice in MATLAB? Are you trying to work in “hard real time”?

    Doug

  8. bencherif replied on :

    I have an ACTI IP camera 8511, while using its activeX, I mad an interface that makes camera movements, snapshots, but I could not grab a full video through matlab, I mean like using webcams, it is possible to acquire a real time video and work with it, but with this IP camera, it is the activeX which cares about this.
    The idea is to make a Region of interest and follow this area, (moving object), but on the activeX, i could not select this ROI.

  9. dhull replied on :

    @Bencherif

    Have you tried the Image Acquisition Toolbox?

    Doug

  10. bencherif replied on :

    It does not manage Ip cameras, as far as I know, I am using an activeX (nvMediaUnified.ocx), I can move, pan tilt the camera, record a video sequence, get snapshots, but I could not stream outside the activeX, let us say to a separate video figure,..
    I think that ACTI are not allowing such procedure (cgi-bin) of the camera webserver accepts only http, rtp or rtsp, requests.
    I read in previous posts of mathworks, that urlread could manage this, but I tried and did not work…

  11. dhull replied on :

    @bencherif

    Please see http://www.mathworks.com/support

  12. dhull replied on :

    @Omer,

    If you are on an unsupported platform, there is not much to be done.

    sorry,
    Doug

  13. Omer Farooque replied on :

    @dhull

    so does that mean ? i cannot use vide processing toolbox for image stabilization on a Mac platform.. or i cannot run the specific demo? i mean can i replace the shaky_video.avi with some other video?
    thanks
    Omer

  14. dhull replied on :

    @Omer,

    Here are the product requirements:

    http://www.mathworks.com/products/viprocessing/requirements.jsp

    Please see http://www.mathworks.com/support for more help.

    Doug

  15. Adi replied on :

    I would like to record video from two webcams (video sources)simultaneously….Can Matlab handles two sources simultaneously or do I need to start and stop video for each camera before I take a snapshot from each camera or update the preview by calling a function…..

  16. dhull replied on :

    @Adi,

    This should be possible with Image Aquisition Toolbox.

    Doug

  17. Ben Kotze replied on :

    I would like to know if you have altered your Matlab demo to accomodate movement detected from a moving platform yet?

  18. dhull replied on :

    http://www.mathworks.com/image-video-processing/demos.html?file=/products/demos/shipping/vipblks/vipstabilize.html

    This is video of a car from a car. I know there is one in the product of a boat from a boat in rough water.

  19. Harsha Avunoori replied on :

    Hey Doug :)

    I have a video with me I have been using the advanced features of VLC player to take the screenshots but is there a way I could directly take snapshot in the MATLAB rather than playing it in VLC player and getting snapshots and then using those snapshots in MATLAB.

    Help me out

    Thanks

  20. dhull replied on :

    @Harsha,

    If you just want to capture a figure window, you can use SAVEAS, or PRINT.

    Doug

  21. ben replied on :

    This looks awesome! The files have been removed, are they still available somewhere else?

    What kind of video files does this support?

    I have mpeg-4 (simple profile) videos that I’d like to scan for motion in a particular area. Something like VitaminD except they can only do real live video streams.

    I’m a bit new to matlab/simulink, so a project like this to work on, and add to, would be perfect!!

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


MathWorks

Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.

Doug's picture

These postings are the author's and don't necessarily represent the opinions of The MathWorks.