https://github.com/enoxsoftware/natcamwithopencvforunityexample
An example of improving performance of video preview on mobile platform by replacing WebCamTexture of Unity standard API with NatCam.
https://github.com/enoxsoftware/natcamwithopencvforunityexample
assetstore natcam-api opencv opencvforunity unity unity-3d unity-asset unity3d
Last synced: about 1 year ago
JSON representation
An example of improving performance of video preview on mobile platform by replacing WebCamTexture of Unity standard API with NatCam.
- Host: GitHub
- URL: https://github.com/enoxsoftware/natcamwithopencvforunityexample
- Owner: EnoxSoftware
- Created: 2018-04-04T15:45:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-27T22:31:19.000Z (about 6 years ago)
- Last Synced: 2025-03-30T22:01:33.158Z (about 1 year ago)
- Topics: assetstore, natcam-api, opencv, opencvforunity, unity, unity-3d, unity-asset, unity3d
- Language: C#
- Homepage:
- Size: 707 KB
- Stars: 25
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NatCam has been deprecated.
**An example using the new asset "NatDevice" has been published.**
[https://github.com/EnoxSoftware/NatDeviceWithOpenCVForUnityExample](https://github.com/EnoxSoftware/NatDeviceWithOpenCVForUnityExample)
---
# NatCam With OpenCVForUnity Example
- An example of a benchmark test integrating NatCam and OpenCVForUnity. (Comparison between WebCamTexture and NatCam API)
- An example of replacing WebCamTextureToMatHelper with NatCamPreviewToMatHelper.
- An example of native sharing and save to the camera roll using NatShare API.
## Environment
- Anddroid (Pixel, Nexus 7) / iOS (iPhone8, iPhone6s)
- Unity >= 2018.3+
- Scripting backend MONO / IL2CPP
- [NatCam - WebCam API](https://assetstore.unity.com/packages/tools/integration/natcam-pro-webcam-api-52154?aid=1011l4ehR) 2.3.1+
- [NatShare - Mobile Sharing API](https://assetstore.unity.com/packages/tools/integration/natshare-mobile-sharing-api-117705?aid=1011l4ehR) 1.2.1+
- [OpenCV for Unity](https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088?aid=1011l4ehR) 2.3.7+
## Demo
- Android [NatCamWithOpenCVForUnityExample.apk](https://github.com/EnoxSoftware/NatCamWithOpenCVForUnityExample/releases)
## Setup
1. Download the latest release unitypackage. [NatCamWithOpenCVForUnityExample.unitypackage](https://github.com/EnoxSoftware/NatCamWithOpenCVForUnityExample/releases)
1. Create a new project. (NatCamWithOpenCVForUnityExample)
1. Import NatCam.
1. Import NatShare.
1. Import OpenCVForUnity.
* Setup the OpenCVForUnity. (Tools > OpenCV for Unity > Set Plugin Import Settings)
1. Import the NatCamWithOpenCVForUnityExample.unitypackage.
1. Change the "Minimum API Level" to 22 or higher in the "Player Settings (Androd)" Inspector.
1. Change the "Target minimum iOS Version" to 11 or higher in the "Player Settings (iOS)" Inspector.
* Set the reason for accessing the camera in "cameraUsageDescription".
1. Add the "Assets/NatCamWithOpenCVForUnityExample/*.unity" files to the "Scenes In Build" list in the "Build Settings" window.
1. Build and Deploy to Android and iOS.
## iOS Instructions
After building an Xcode project from Unity, add the following keys to the `Info.plist` file with a good description:
- `NSPhotoLibraryUsageDescription`
- `NSPhotoLibraryAddUsageDescription`
## ScreenShot


