Video Stabilization with OpenCV

后端 未结 8 2104
遇见更好的自我
遇见更好的自我 2020-11-30 19:44

I have a video feed which is taken with a moving camera and contains moving objects. I would like to stabilize the video, so that all stationary objects will remain stationa

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 20:51

    Background: I was working on this research project where I was trying to calculate that how long would it take for person standing in the queue to reach to the counter. First thing I required was FOOTAGE so I went to the campus and recorded some tourist moving in the queue to get tickets. Till this point I had not idea how would I gonna calculate queuing time and what pre-caution should I take while recording the footage. At the end of the day I found that all the footage I recorded was recorded with shaky camera. So at this point I was first required to stabilize the video and then only develop other solution to calculate queuing time.

    Video Stabilization using Template Matching

    • Find static objects such as poll, door or something that you know are not supposed to move
    • Use template matching to calculate offset of change of location of static object(relative to the frame boundaries) in each consecutive frame.
    • Translate the each frame with the offset value i.e. let's say tx and ty.

    Result Footage:

    Gif to show the result of this technique

    As you can see in the gif that selected static object remain static w.r.t the frame boundaries while motion can be see by black filling from the edges of the frame.

提交回复
热议问题