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. 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. Have a look at OpenCV Memory Management. The article is for OpenCV's C interface, but you might be able to get some ideas out of it.
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.
Try commenting out your image processing code and see if your application passes the 2200 frames limitation. 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.
精彩评论