I got bad access error when trying to get the reference image back from UIImage:
CGImageRef imageRef = mat2CGImageRef(mat);
_documentUIImage = [[UIImage alloc] initWithCGImage:imageRef];
CGImageRelease(imageRef);
After that if I want to get the CGImageRef from the uiimage I got bad access error!
return _documentUIImage.CGImage
I believe that the variable UIImage should have different address than the image ref.. so why after releasing it I got bad access?
Best regards