LightBuzz / OpenCV

OpenCV for iOS and VisionOS.
Apache License 2.0
17 stars 2 forks source link

OpenCV for Apple platforms

This repository provides pre-built universal OpenCV binaries and demos for Apple platforms: iOS, iPadOS, visionOS, Mac, and simulators.

opencv-vision-pro-cover

Supported platforms and architectures

Building OpenCV as an .xcframework library allows us to support multiple platforms with a single binary.

Platform Architecture
iOS/iPadOS ARM64
iOS/iPadOS simulator ARM64
iOS/iPadOS simulator x86_64
visionOS ARM64
visionOS simulator ARM64
Mac Catalyst ARM64

⬇️ Download opencv2.xcframework

How to run

This repository includes a sample project. Here's what you need to do:

  1. Download opencv2.xcframework.
  2. Create an Xcode multiplatform project.
  3. Add opencv2.xcframework under Frameworks, Libraries, and Embedded Content.
  4. Create a Bridging Header.
  5. Create a Prefix Header.
  6. Add and populate our OpenCV wrapper.
  7. Select your build target (iPhone device, visionOS device, simulator, etc).
  8. Run.

https://github.com/LightBuzz/OpenCV/assets/562680/e97955fa-6070-4f4f-8dc7-42518573fbac

Build OpenCV for all Apple platforms

👉 Read the complete guide

🪄 Here's the magic script to build OpenCV from scratch:

git clone https://github.com/opencv/opencv.git
git checkout tags/4.9.0
cd opencv

python3 platforms/apple/build_xcframework.py --out build_all \
--iphoneos_deployment_target 14.0 \
--iphoneos_archs arm64 \
--iphonesimulator_archs arm64,x86_64 \
--visionos_archs arm64 \
--visionsimulator_archs arm64 \
--build_only_specified_archs True \
--without objc

💡 Need a custom solution?

We're proud to offer our open-source project as a stepping stone for your computer vision and AI endeavors. But what if your project demands features or integrations that go beyond what our open-source offering provides? Contact us for a custom project solution!

🔗 Contact LightBuzz 🚀

LightBuzz is here to turn your vision into reality. Let's discuss how we can bring more value to your project and drive its success.

Contact us today ➡️

👋 Stay in touch

📖 Resources