This example shows how to use the NativeGallery plugin to retrieve an image or video file path from the in-device storage gallery in an Android/iPhone device via a file picker and apply image processing using OpenCVForUnity.
- NativeGalleryImageExample
- NativeGalleryVideoExample
- Android (Galaxy S10+ SC-04L) / iPhone SE
- Unity 2020.3.48f1+
- OpenCV for Unity 2.6.0+
- Native Gallery for Android & iOS 1.8.0+
- Download the latest release unitypackage. NativeGalleryWithOpenCVForUnityExample.unitypackage
- Create a new project. (NativeGalleryWithOpenCVForUnityExample)
- Import OpenCVForUnity.
- Import Native Gallery for Android & iOS.
- Follow the instructions on the official page for installation and setup. [https://github.com/yasirkula/UnityNativeGallery(https://github.com/yasirkula/UnityNativeGallery?tab=readme-ov-file#installation)
- Import the NativeGalleryWithOpenCVForUnityExample.unitypackage.
- Add the "Assets/NativeGalleryWithOpenCVForUnityExample/*.unity" files to the "Scenes In Build" list in the "Build Settings" window.
- Build and Deploy.