简体   繁体   English

如何平均对象在OpenCV中没有移动的视频文件的所有帧的平均值?

[英]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.

相关问题 OpenCV:如何在移动相机的视频中检测(并在其上绘制矩形)所有移动对象? - OpenCV: How to detect (and draw rectange on it) all moving objects at video of moving camera? 无论如何,我可以使用数组在opencv c ++中存储所有视频帧(无论视频多长时间)吗? - Is there anyway I can use array to store all video frames (no matter how long the video is) in opencv c++? 使用OpenCV使视频帧不失真 - Undistort video frames with OpenCV 调试一种使用C ++中的OpenCV从视频中查找帧的移动平均值以进行运动检测的方法 - debugging a method for finding running average of frames from video for motion detection using OpenCV in C++ 与 MATLAB 相比,OpenCV 从视频文件中提取的帧更少 - OpenCV extracts less frames from video file compared to MATLAB opencv删除视频提要到帧 - opencv takedown video feed to frames OpenCV:读取视频序列的帧 - OpenCV: Reading the frames of a video sequence OpenCV IOS Swift 2:如何实现CvVideoCameraDelegate协议处理视频帧 - OpenCV IOS Swift 2 :How to implement the CvVideoCameraDelegate protocol process Video Frames 如何使用 OpenCV 而不是 C++ 将视频分成帧 - How to break a video into frames using OpenCV over C++ 如何从视频中选择两个帧? OpenCV的C + + - How to select two frames from a video? opencv c++
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM