OpenCV iOS - Image Processing¶
OpenCV iOS - Image Processing
In this tutorial we will learn how to do basic image processing using OpenCV in iOS.
In OpenCV all the image processing operations are usually carried out on the Mat structure. In iOS however, to render an image on screen it have to be an instance of the UIImage class. To convert an OpenCV Mat to an UIImage we use the Core Graphics framework available in iOS. Below is the code needed to covert back and forth between Mat’s and UIImage’s.
After the processing we need to convert it back to UIImage. The code below can handle both gray-scale and color image conversions (determined by the number of channels in the if statement).
After the processing we need to convert it back to UIImage.
Check out an instance of running code with more Image Effects on YouTube .