Search code examples
iosopencvavfoundationavcapturesessionios-camera

How to use CvPhotoCamera with iOS openCV?


I have followed the tutorial on how to use the CvVideoCamera object to play a video and apply some processing.

I am now interested to use the CvPhotoCamera object to capture a high definition picture by using the takePicture method. However, the tutorial uses CvVideoCamera and does not make any references to CvPhotoCamera.

Both CvPhotoCamera and CvVideoCamera are inheriting from CvAbstractCamera. They are sister classes so I have no idea on how can I use the takePicture function.


Solution

  • My solution was to create a new class named CvVideoPhotoCamera which inherits from CvAbstractCamera. The content of CvVideoPhotoCamera was made from a merge between CvVideoCamera and CvPhotoCamera.