For working in iOS, OpenCV provides its usual C++ interface that can be invoked from Objective-C++. In recent years, however, Apple has encouraged iOS application developers to use the more versatile Swift language for building applications and forgo Objective-C. Luckily, a bridge between Swift and Objective-C (and Objective-C++) can be easily created, allowing us to invoke Objective-C functions from Swift. Xcode automates much of the process, and creates the necessary glue code.
To start, we create a new file (Command-N) in Xcode and select Cocoa Touch Class, as shown in the following screenshot:
Choose a meaningful name for the file (for example, StitchingWrapper) and make sure to select Objective-C as the language, as shown in the following screenshot:
Next, as shown in the following screenshot, confirm that Xcode should create...