简体   繁体   English

OpenCv-C ++-在视频中间停止工作

[英]OpenCv-C++- Stop working in the middle of the video

I reading an AVI video file and processing each frame, but after about 2200 frames my program will stop without any error. 我读取AVI视频文件并处理每一帧,但在大约2200帧之后,我的程序将停止而没有任何错误。 Can anyone help me where should be the problem? 谁能帮我解决问题所在?

You're probably not releasing some images after you're done using them. 使用完毕后,您可能不会发布一些图像。 After a certain point, all your RAM is filled up, so your program crashes. 在某一点之后,所有的RAM都被填满,所以你的程序崩溃了。 Have a look at OpenCV Memory Management . 看一下OpenCV内存管理 The article is for OpenCV's C interface, but you might be able to get some ideas out of it. 本文是针对OpenCV的C接口的,但是您可能可以从中获得一些想法。

Most probably there's some memory leak on your program, and it doesn't necessarily means it's related to OpenCV resources, but you should take a look at @Utkarsh suggestion anyway, it's good stuff. 很可能你的程序有一些内存泄漏,并不一定意味着它与OpenCV资源有关,但你应该看看@Utkarsh的建议,无论如何,它是好东西。

Try commenting out your image processing code and see if your application passes the 2200 frames limitation. 尝试注释掉图像处理代码,并查看您的应用程序是否通过了2200帧限制。 If it does you can easily spot the leak. 如果这样,您可以轻松发现泄漏。

You will have to share your code if you need more help. 如果您需要更多帮助,则必须共享您的代码。 Guessing what the problem could be won't take us anywhere. 猜测可能会出现什么问题不会带我们到任何地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM