Reputation: 3
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?
Upvotes: 0
Views: 306
Reputation: 93410
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.
Upvotes: 1
Reputation: 3305
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.
Upvotes: 1