DrPetter's homepage



Lurch



Way back in the late 90's me and a friend often played around making crappy 5-minute movies using his camcorder. We were hooked on special effects like any kids but didn't really have the equipment or skills to make anything useful. Towards 1999-2000 though, when I began doing slightly more advanced programming on the PC (as opposed to AMOS games on the Amiga) I got the idea that it might be possible to write my own application for creating smooth slowmotion by analyzing movement between adjacent frames of a video sequence.
I spent some time thinking about it but didn't get very far. The conclusion was that I would need some advanced morphing algorithm to smoothly move different parts of the image, and decided that it wasn't something I could reasonably implement at the time.

Some 6 years later though, I figured I'd have another shot at it. Once again my brother indirectly served as a prod to get me going - he was taping himself and his pals doing skateboard tricks and ran them in choppy slowmotion by simply reducing the framerate from what he got out of the PAL camera, which looked kinda dull.

The original goal of creating super-smooth skateboard clips was doomed to fail though, and I basically knew that from the start. Since the board can make one whole revolution over a handful of frames during the average trick, you just don't have enough information to automatically interpret and recreate the motion. I was hoping to at least make the slower parts of the image move smoothly though, like the arms and legs of a rider.

Results were pretty good in the end I suppose, although I wasn't too happy with it during the time I worked since I couldn't completely iron out the occasional glitchy spots that appeared in some situations.

Other scenes with more "blunt" movement did a lot better, with little blurring or other artifacts as long as there weren't complex moving parts interacting or occluding each other.

Turns out I didn't need any "complex morphing" after all. I basically used "point sprites" blended with a radially decreasing weight, so you'd get most impact at the center point and less towards the edges. With several of these in the same area, each associated with a different part of the image (or different images), you get a kind of morphing that serves well for this purpose.

Actual motion is analyzed with a relatively crude method of comparing small rectangular regions of two images, combined with edge detection to prioritize relevant areas and avoid incorrect movement estimation.

The biggest problem is with contours, where an object moves in relation to a background pattern. I tried a few different approaches to dealing with this by detecting sharp transitions between differently moving regions, but I never reached a useful solution. For simple scenes where the background is relatively flat-colored, it's hardly noticable though.

I'm impressed with how Windows Media Player 9 can do this in real-time with e.g. clips recorded at 15 fps and played back at 30. My application needs a minute or two for each frame processed :P

There's a demo clip available for download which shows off one of the simpler scenes that yielded a decent result.


  


lurch-f1.avi (1 MB)
First half is the original video clip, second is after calculating intermediate frames.



Back to all projects


Page updated on March 25   2010