Вопрос

I am using opencv and want to display the image while processing it.
My problem is, when I use MatToUIImage, memory usage is increasing so much that my app crashes.

But what else can I do here? imageis a member of the view controller and not instantiated in the method.
Maybe it has something to do with processImage being a delegate method of opencv?

- (void)processImage:(cv::Mat&)img
{
   image = img;
   testImage = MatToUIImage(image);
}
Это было полезно?

Решение

In reply to the last two comments:

AFAIK reference counting and releasing memory of pointers are different things. If you don't release the pointer then its reference won't decrease and won't be cleared from memory. No matter what, you need to release pointers.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top