O'Reilly logo

Visual Media Processing Using MATLAB Beginner's Guide by George Siogkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – tracking feature points for motion compensation of a shaky video

For this example, we will use the shaky_car.avi video file included in the Computer Vision System Toolbox of MATLAB. In the first frame, we will manually choose an area in which we will be looking for feature points. Then, we will try to track these feature points in the rest of the frames in the video. Finally, the coordinate differences between the points we track will be used for motion compensation. Let's start:

  1. The first step will be, as always, to load our video:
    >> videoObj = VideoReader('shaky_car.avi');
  2. Now, we will read a frame:
    >> frame = read(videoObj,1);
  3. Next, we choose a rectangular area:
    >> imshow(frame);
    >> ROI=round(getPosition(imrect))
  4. We can also show ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required