dvgrab film.avi
Next we will split the file film.avi into separate frames. This can be done with the program ffmpeg from http://www.ffmpeg.org/.
This will create a number of frame files. Now we need to define what "background" means. Use gimp or any similar program to cut off the background from one of the frames.
Store it in the file background.png. Then unzip the archive movie_maker_scripts.tar.gz to the directory PERL and type:
perl -I../PERL -f ../PERL/detect_background.pl background.png
As a result you will obtain the HVS parameters of your background. Now open the background_remover.pm in an editor and edit the line:
The values should reflect the minimum and maximum for H and V, respectively. Once this is done we are ready to remove the background from all the frames. Go to the directory with the frames, create a directory RESULT and then run:
perl -I../../PERL ../../PERL/remove_background.pl . RESULT
After a while the directory RESULT will contain a number of frames without the background, like the one below:
Now is a good time to learn Blender http://www.blender.org/, or a similar program to build a virtual 3D environment. It can look like:
Note that in this case we used one of the frames to create the wizard's picture hanging on the wall. Next step will be to paste the virtual environment into the frames without background. I will describe how to do it next time.
No comments:
Post a Comment