foundry/OpenCVSwiftStitch

Version 6 of OpenCVStitch. How to stitch images using OpenCV on iOS. This version demonstrates using Swift and C++ together in one project - avoiding the Objective-C wrapper that was needed prior to Swift v5.9.

What it solves

This project provides a practical implementation for stitching multiple images into a panorama on iOS, specifically demonstrating how to integrate the OpenCV computer vision library into a Swift-based application.

How it works

It utilizes the OpenCV Stitcher class to process images. The project is designed to showcase Swift/C++ interoperability, allowing Swift to interface directly with the C++ OpenCV API. To handle specific OpenCV API types that cannot be accessed directly from Swift, it employs a small C++ wrapper and a bridging header to maintain a clean separation between the languages.

Who it’s for

iOS developers who want to implement image stitching or panorama creation using OpenCV, and those looking for a real-world example of how to mix Swift and C++ in a single project.

Highlights

  • Swift/C++ Interop: Implements direct interfacing between Swift and C++ (Swift 5.9+), removing the need for Objective-C wrappers.
  • OpenCV Integration: Demonstrates the use of the OpenCV Stitcher class for panorama generation.
  • Flexible Installation: Supports installation via Swift Package Manager (SPM) or manual framework installation.
  • Cross-Version Support: Provides historical versions and branches for compatibility with older versions of Xcode and Swift.

Related

  • Project
  • Project
  • Project
  • Project
  • Project