问题
I am developing an application using opencv as my college project, it's almost done except that i am unable to overlay a animated video( a flash video) over my camera stream, i want to capture user mouth and after detecting mouth i want to overlay a animated video of smoke. Please can anyone help me with the overlaying part? If it is not possible can you shed some light on any workaround
I am using opencv 2.3.1 and ubuntu 11.10.
回答1:
Basically, all you need to do is set a ROI (Region of Interested) in the video frame and then perform the operation to copy an arbitrary image to that specific position in the video frame.
I've demonstrated how to do something similar in this thread, where the user selects the ROI with the mouse and the system performs a grayscale conversion of that area.
Also, this thread shows how to use the mouse to draw over the webcam window.
Both threads use the C interface of OpenCV and they show how to accomplish the overlay effect you are looking for.
来源:https://stackoverflow.com/questions/11334443/how-to-overlay-small-animation-on-camera-stream-in-opencv