We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I want to use a movie as background while capturing video.
The movie will be displayed on all the black pixels (or white pixels) of my captured video (those pixels in the captures video are suppose to be transparent).
Does anyone know if this could even be possible?
Thanks a lot. Your help is blessed.
Answers
@sufi -- Yes, it is possible.
The technique you are looking for is called "background subtraction" (a.k.a. foreground detection).
There are a lot of examples of doing this with live video, e.g. a webcam stream -- see this video starting around 40 seconds:
Some people use computer vision libraries like OpenCV, and some use a simple snapshot of the current camera background and then compute anything that is "different" (e.g. a figure standing in front of a camera).
When you say "The movie will be displayed on all the black pixels (or white pixels) of my captured video" -- what is this video being captured from, or how is this being done? It is rare for a live video stream based on lighting conditions to have pure-black or pure-white pixels -- they are usually just dark or light. You may need to set a threshold.
In general, if you really do have two video streams and the areas to combine them are already clearly indicated -- you don't have to "detect" the foreground or background -- then you can combine them in a simple way with masking -- during each frame in draw, make one video frame the mask, then apply it to the other video frame.
Depending on your ultimate goal, you can program this yourself or there are some live video tools which are very good at doing this -- see for example PraxisLive (http://www.praxislive.org/).