An Xcode project using OpenCV library in macOS GUI apps.
The sample app shows results of CLAHE (Contrast Limited Adaptive Histogram Equalization) / Gaussian blur filters and Find contours operation.
The picture is the house of American Philosophical Society in Philadelphia, USA.
(Taken from the backyard of Independence Hall)
I had been looking for sample codes of OpenCV used in macOS GUI apps (not for iOS, iPadOS or command line tools). But I couldn't.
So, I made a simple sample app of macOS using OpenCV library. I also built ‘opencv2.framework’ of version 4.3.0, and used it in this Xcode project.
OpenCV site : https://opencv.org/
Source of the framework : https://opencv.org/releases/
I follow the license of OpenCV for OpenCV library and opencv2.framework.
Download 'opencv2.framework' version 4.5.0 that I built for my macOS apps and this sample code, from HERE. And put it in your Xcode project as following:
OCV.mm / OCV.h
A wrapper class written in objective C++ (.mm file). They connect other objective C codes for macOS to OpenCV framework (opencv2.framework) written in C++11.
OCVImage.m / OCVImage.h
An objective C class to munipulate bitmap data for OpenCV based on macOS images (NSImage, CGImage and NSBitmapImageRep). If the bitmap is color data with multiple channels, the color order stored in this class is BGR (Blue-Green-Red), default in OpenCV.
OCVImageController.m / OCVImageController.h
Codes to maintain window and other GUIs for this sample app.