How to overlay small animation on camera stream in opencv

风流意气都作罢 提交于 2019-12-22 11:25:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!