[英]How to average all the frames of a video file in which objects are not moving in OpenCV?
I have different frames of a video file. 我有一个视频文件的不同帧。 Now, on observing each frames separately, I noticed there are many frames in which objects has not moved. 现在,在分别观察每个帧时,我注意到有许多帧中对象没有移动。 I need to do averaging of all those frames and make a single frame using OpenCV. 我需要对所有这些帧进行平均,并使用OpenCV制作单个帧。
I am totally new in OpenCV, so It will be great help if can able to get codes for frame averaging. 我是OpenCV的新手,因此,如果能够获得帧平均代码,将对您有很大帮助。
One simple technique... 一种简单的技术...
Subtract previous frame from present frame... using this opencv function . 使用此opencv函数从当前帧中减去前一帧。 Take only those frame which have difference negative or positive above a threshold...like in the frames where the object is almost static then on doing frame difference you will get low value...skip those frames....again when only the object is moving and the rest of the background is more or less static like a man moving in a park, there just you can store the position of the man and the background gets duplicated... 只取那些在阈值之上具有负或正的差异的帧...就像在对象几乎是静态的帧中一样,然后在进行帧差异时,您将获得较低的值...跳过这些帧......再次仅当对象正在移动,背景的其余部分或多或少是静态的,就像一个人在公园中移动一样,在那里您可以存储该人的位置,并且背景会重复...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.