I've been running into the same issue. I managed to fix it partially though.
I pulled the latest opencv version of github and rebuild the framework myself after editing the following:
In "cap_ios_abstract_camera.mm" edit the stop method to the following:
- (void)stop;
{
NSLog(@"[Camera] video stopped");
running = NO;
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
[self.captureSession stopRunning];
[self.captureSession release];
self.captureSession = nil;
self.captureVideoPreviewLayer = nil;
self.videoCaptureConnection = nil;
captureSessionLoaded = NO;
}
The only difference with the original is [self.captureSession release] which seems to "properly" clean the AVCaptureSession. Memory usage is still rising slightly on each start/stop (might even be bad memory management in the rest of my code) but not exponentially like before this fix (which resulted into a crash).
(if you're having troubles building the opencv2.framework from source, you can always have a look at a previous answer of mine.)
Hope this helps!
I'm also facing memory issue with iOS7.
Following the image detection, I'm calling [videoCamera stop]; when I detect an image then [videoCamera start]; if something when wrong during the retrieving image process on the main thread but the more I use stop and start function, the more my application become slow until my camera stop moving :S
Furthermore due to iOS7 I'm getting 4 warning when calling [videoCamera start] function due to deprecated method which are :
AVCaptureConnection - isVideoMinFrameDurationSupported
AVCaptureConnection - setVideoMinFrameDuration:
AVCaptureConnection - isVideoMaxFrameDurationSupported
AVCaptureConnection - setVideoMaxFrameDuration:
is something can be done for not getting CvVideoCamera slow?
Sorry, I posted this as an answer previously, but were you able to find a solution?
Same issue over here, currently trying to build the latest framework from source to see if that fixes the issue. Have you guys made any progress on this?
Same issue here..., What I have noticed while I start and stop the CVVideoCamera is that first 5times or so is fine, but there is one point where the suddenly the performance changes, I mean that it looks like is not just accumulative, if you check the CPU usage you will notice a big change from 10% or so to 99... and then the memory usage start growing quickly...
I have to say that also have tried to recreate the object and it didn't work.
I hope this information will be helpful to find where the problem is. I'll keep trying to solve it in the meantime.