Assignment 3B: Warping into Video (or fun with frames in video)

Due Thurs, April 16 (100 pts)

Overview

In this assignment you will experiment with inserting transformed images into a video. These transformed images will either come from a single frame, or from videos themselves.

Part 1 (70 pts) - Embedding an image into your video

+ =
Input Video - frames.avi - Click to play. Uncompressed version available here Selected frame that you want to embed, and selected rectangular region Result video with embedded image - Click to play. Uncompressed version available here

Load in your test video, frames2.avi.gz is a gzipped avi file containing a test movie and can be read in (after uncompressing) using aviread in matlab. Alternatively I have also provided a matfile containing the frames, frames.mat and can be read in using load in matlab.

First, choose the video frame that you want to embed (imagesc and pause are useful for viewing the frames of a video). Next, select the rectangular region of this video frame that you want to embed (source points). Make sure the part you select is perfectly rectangular otherwise your result video will have visual artifacts. For every video frame after your selected video frame, click on the four corners of the cardboard frame (target points). There have been colored dots placed at the corners to aid you in good localization. I would suggest saving these locations so that you only have to click on them once.

For every video frame after your selected video frame, compute the transform between the target points and source points. Transform the source region accordingly, and embed it in the target region. Here you will just need to apply your frameit.m function from Assignment 3A.

Save the resulting video as result.avi. You can save an avi by creating an avifile object then repeatedly adding the video frames you have generated.

Part 2 (30 pts) - Embedding a video into your video

+ =
Input Video - frames.avi - Click to play. Uncompressed version available here Video that you want to embed - You will add this into the Input Video, offset in time. Click to play. Uncompressed version available here Result video with embedded video - Click to play. Uncompressed version available here

Instead of inserting a single static image into a set of frames, you can insert a different image into each frame, thereby embedding a video into a video. For every video frame after your selected video frame, insert a transformed frame from earlier in the video. For example if you are at video frame 120 and want your time offset to be -30 frames, then transform video frame 90 and embed it into the result video frame. You can either transform the whole image (as I have done in this example), or transform your hand selected regions, producing different effects.

Save the resulting video as resultvideo.avi. You can save an avi by creating an avifile object then repeatedly adding the video frames you have generated.

Extra Credit

Add a sound track to your video. Matlab doesn't have this capability, so you would have to do this in another program (10 pts).
Find or capture your own images, and play around with embedding them into your video (10 pts).
Find or capture your own video, and play around with embedding this into my test video (10 pts).
Find or capture your own video, and play around with embedding this into your own video (10 pts).

What to turn in

Please email me:

Please post online (either to your Sites directory or elsewhere):