Microsoft has released a program for seamless looping animation.
When watching a GIF animation or other looped clips, there is always a noticeable transition from the end of the video to the beginning, as if to a jump to the starting position. Experts from Microsoft Research have released an automatic video processing program that elegantly solves this problem.
Work algorithms are described in scientific work . In short, the program isolates all moving objects in the frame, determines the speed of their movement. After that, the optimization of the movement of elements is carried out so that the first and the last frame of the video match. Roughly speaking, some objects need to be slightly slowed down, while others - slightly accelerated. Optimization is almost invisible and looks very natural (see video under the cut). In addition to seamless animations, the program allows you to create beautiful special effects. For example, “freeze” some objects in the frame, while others will continue to move. ')
As shown in the video, the interface is very user friendly: the program automatically recognizes all moving objects. When working with individual objects, it is enough to select them with a mouse: freezing or looping is available both for the entire video and for individual objects. It is very beautiful when you freeze the whole landscape, at the same time launching movements only of flowers or flags in the wind.
In general, Microsoft Research experts, without knowing it, made an ideal tool for GIF-animation.
You can experiment with the program yourself: it is available for free download from the Microsoft Research website (for work, a 64-bit version of Windows 7 or Windows 8 with 8 GB of RAM and installed Visual Studio runtime components is required).
The authors of the scientific work believe that their method can be used to compress videos. In fact, an hour-long shooting of a 1-gigabyte waterfall can be easily compressed into 1 megabyte by simply looping a 10-second segment. It is possible that the looping of individual objects in the frame will be used in video compression algorithms of the new generation.
In this case, the authors recognize that the technology has certain limitations. For example, when processing a video clip where a girl in a fluttering dress sits on stones near the seashore, everything is perfectly processed until she accidentally moves her hand at the end of the video - such spontaneous movements spoil the whole picture. Actually, the algorithm in the current implementation will simply erase this movement from the video.
In addition, the program gives funny glitches in some situations. For example, while cycling busy traffic on motorways, some cars disappear in the middle of the road. The boat swinging on the waves does not look very beautiful, since the algorithm dynamically changes its shape.