Unity-AR-ColorMapping
Unity-AR-ColorMapping copied to clipboard
Unity AR Colormapping for easyar,vuforia,maxstar, arkit, arcore
ColorMapping
This project is an easy-to-apply AR Coloring Library for Unity.
This project can be applied to AR Engines of MaxstAR, EasyAR, Vuforia, ARFoundation(ARkit, ARcore).
To use it for business projects, you need to purchase a separate license for the AR Engine.
View Demo
Table of Contents
- Requirements
- Installation
-
Quick Start
- with MaxstAR
- with EasyAR
- with Vuforia
- with ARFoundation(ARkit, ARcore)
- Release
- Future Release
- Trouble Shooting
- Known Issues
- Contributing
- License
- Contact
Requirements
- Unity3D 2019.3.14f1
- MaxstAR 5.0.2v
- EasyAR 3.1.0v
- Vuforia Engine AR Unity Package 9.5.4v
- ARFoundation 2.1.8v
- Visual Studio 2019
- opencv-3.4.10-android-sdk
- opencv.framework(*3.4.11 version)
* As of August 3, 2021, the latest version of Unity3D and the latest version of each AR engine have been tested.
- Unity3D 2021.1.6f1
- MaxstAR 5.0.5v
- EasyAR 4.3.0v
- Vuforia Engine AR Unity Package 10.0v
- ARFoundation 4.1.7v
Installation
1. Clone a repository or download it as zip.
git clone https://github.com/airar-dev/ColorMapping.git
2. Importing the AR Engine SDK to be used together.
(You can use MaxstAR, EasyAR, Vuforia, ARFoundation(ARkit, ARcore))
Quick Start
with MaxstAR
1. Create Project
- Create an empty Unity3D project.
2. Import MaxstAR
- Import MaxstAR SDK(5.0.2v +).
3. Import Sample Package
- After extracting the downloaded file,
import ColorMappingWithMaxstARSample.unitypackage from
ColorMapping-master -> Sample folder.
4. Import Native Library
- Import ‘libAirarColorMap.so, libopencv_java3.so’ file for Android.
(Set the CPU to ARM64 in the platform settings of the libAirarColorMap.so, libopencv_java3.so files.)
- Import ‘libAirarColorMap.a, opencv2.framework’ file for iOS.
5. Player Settings for Android
Allow 'unsafe' code | Check the Allow 'unsafe' code |
Scripting Backend | Select IL2CPP |
Target Architectures | Check Arm64 architecture(uncheck ARM7) |
Scripting Define Symbols | Add ‘USE_MAXSTAR’ into Scripting Define Symbols |
6. Player Settings for iOS
Allow 'unsafe' code | Check the Allow 'unsafe' code |
Scripting Backend | Select IL2CPP |
Target Architectures | Check Arm64 architecture(uncheck ARM7) |
Scripting Define Symbols | Add ‘USE_MAXSTAR’ into Scripting Define Symbols |
7. Setting for 3D Contents
‘coloring’ tag | Set ‘coloring’ tag for Object containing the material to which the colored texture is applied |
8. MaxstARColorMapping.cs
trackableBehaviour | MaxstAR ImageTrackableBehaviour |
ARContents | 3D object to augment |
RealWidth | Actual horizontal size of the marker image |
RealHeight | Actual vertical size of the marker image |
9. Build
- Build by selecting the MaxstARSample scene under ColorMapping -> Scenes.
with EasyAR
1. Create Project
- Create an empty Unity3D project.
2. Initialize EasyAR
- EasyAR 3.1.0 Version + required.
- For EasyAR to work, a license key is required.
3. Import Sample Package
- After extracting the downloaded file,
import ColorMappingWithEasyARSample.unitypackage from
ColorMapping-master -> Sample folder.
4. Import Native Library
- Import ‘libAirarColorMap.so, libopencv_java3.so’ file for Android.
(Set the CPU to ARM64 in the platform settings of the libAirarColorMap.so, libopencv_java3.so files.)
- Import ‘libAirarColorMap.a, opencv2.framework’ file for iOS.
5. Player Settings for Android
Allow 'unsafe' code | Check the Allow 'unsafe' code |
Graphics APIs | Remove Vulkan from the Graphic API list |
Scripting Backend | Select IL2CPP |
Target Architectures | Check Arm64 architecture(uncheck ARM7) |
Scripting Define Symbols | Add 'USE_EASYAR' into Scripting Define Symbols |
6. Player Settings for iOS
Allow 'unsafe' code | Check the Allow 'unsafe' code |
Graphics APIs | Remove Metal from the Graphic API list |
Scripting Backend | Select IL2CPP |
Architecture | Check Arm64 architecture(uncheck ARM7) |
Scripting Define Symbols | Add 'USE_EASYAR' into Scripting Define Symbols |
7. Setting for 3D Contents
‘coloring’ tag | Set ‘coloring’ tag for Object containing the material to which the colored texture is applied |
8. EasyARColorMapping.cs
ImageTargetController | EasyAR ImageTargetController |
ARContents | 3D object to augment |
RealWidth | Actual horizontal size of the marker image |
RealHeight | Actual vertical size of the marker image |
9. Build
- Build by selecting the EasyARSample scene under ColorMapping -> Scenes.
with Vuforia
1. Create Project
- Create an empty Unity3D project.
2. Import Vuforia Unity Package
- Importing the Vuforia Engine AR Unity Package(9.5.4v +).
3. Import Sample Package
- After extracting the downloaded file,
import ColorMappingWithVuforiaSample.unitypackage from
ColorMapping-master -> Sample folder.
4. Import Native Library
- Import ‘libAirarColorMap.so, libopencv_java3.so’ file for Android.
(Set the CPU to ARM64 in the platform settings of the libAirarColorMap.so, libopencv_java3.so files.)
- Import ‘libAirarColorMap.a, opencv2.framework’ file for iOS.
5. Player Settings for Android
Allow 'unsafe' code | Check the Allow 'unsafe' code |
Scripting Backend | Select IL2CPP |
Target Architectures | Check Arm64 architecture(uncheck ARM7) |
Scripting Define Symbols | Add 'USE_VUFORIA' into Scripting Define Symbols |
6. Player Settings for iOS
Allow 'unsafe' code | Check the Allow 'unsafe' code |
Scripting Backend | Select IL2CPP |
Target Architectures | Check Arm64 architecture(uncheck ARM7) |
Scripting Define Symbols | Add 'USE_VUFORIA' into Scripting Define Symbols |
7. Setting for 3D Contents
‘coloring’ tag | Set ‘coloring’ tag for Object containing the material to which the colored texture is applied |
8. VuforiaColorMapping.cs
ImageTaget | Vuforia ImageTargetBehaviour |
ARContents | 3D object to augment |
RealWidth | Actual horizontal size of the marker image |
RealHeight | Actual vertical size of the marker image |
9. Build
- Build by selecting the VuforiaSample scene under ColorMapping -> Scenes.
with ARFoundation(ARkit, ARcore)
1. Create Project
- Create an empty Unity3D project.
2. Import ARFoundation Unity Package
- Importing the ARFoundation(2.1.8v +),
ARCore(for Android)(2.1.11v +), ARKit(for iOS)(2.1.9v +) Unity Package.
3. Import Sample Package
- After extracting the downloaded file,
import ColorMappingWithARFoundationSample.unitypackage from
ColorMapping-master -> Sample folder.
4. Import Native Library
- Import ‘libAirarColorMap.so, libopencv_java3.so’ file for Android.
(Set the CPU to ARM64 in the platform settings of the libAirarColorMap.so, libopencv_java3.so files.)
- Import ‘libAirarColorMap.a, opencv2.framework’ file for iOS.
5. Player Settings for Android
Allow 'unsafe' code | Check the Allow 'unsafe' code |
Scripting Backend | Select IL2CPP |
Target Architectures | Check Arm64 architecture(uncheck ARM7) |
Scripting Define Symbols | Add 'USE_ARFOUNDATION' into Scripting Define Symbols |
Minimum API Level | Android 7.0(API Level 24)+ |
6. Player Settings for iOS
Allow 'unsafe' code | Check the Allow 'unsafe' code |
Scripting Backend | Select IL2CPP |
Architecture | Check Arm64 architecture(uncheck ARM7) |
Scripting Define Symbols | Add 'USE_ARFOUNDATION' into Scripting Define Symbols |
Target minimum iOS Version | 11.0+ |
7. Setting for 3D Contents
‘coloring’ tag | Set ‘coloring’ tag for Object containing the material to which the colored texture is applied |
8. ARFoundationColorMapping.cs
ImageManager | ARTrackedImageManager |
ARContents | 3D object to augment |
RealWidth | Actual horizontal size of the marker image |
RealHeight | Actual vertical size of the marker image |
7. Build
- Build by selecting the ARFoundationSample scene under ColorMapping -> Scenes.
Release
Version | New Features | Date |
---|---|---|
v1.3.1 | the latest version of Unity3D and the latest version of each AR engine have been tested. | 2021.08.03 |
v1.3.0 | update all sample for Android/iOS | 2020.10.27 |
v1.2.1 | modify sample unitypackages for android | 2020.10.23 |
v1.2.0 | update android sample | 2020.10.23 |
v1.1.0 | add iOS Library | 2020.10.21 |
v1.0.1 | add EasyAR sample | 2020.10.07 |
v1.0.0 | Apply MaxstAR, EasyAR | 2020.09.09 |
Future Release
- We will add a method for creating coloring 3D content in the near future.
Trouble Shooting
- If an error such as "Undefined symbols for architecture arm64" occurs.
example:
Undefined symbols for architecture arm64:
"cv::getPerspectiveTransform(cv::Point_<float> const*, cv::Point_<float> const*)", referenced from:
_ImageProc in libAirarColorMap.a(AirarColorMap.o)
(maybe you meant: cv::getPerspectiveTransform(cv::Point_<float> const*, cv::Point_<float> const*, int))
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
solutions:
Be sure to use version 3.4.11 of the opencv framework.
Known issues
- The coloring is not very accurate when used with the MaxstAR engine.
Contributing
- Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
1. Fork the Project.
2. Create your Feature Branch.
3. Commit your Changes.
4. Push to the Branch.
5. Open a Pull Request.
License
- The 3-Clause BSD License. (see the LICENSE file inside this repo)
Contact
- [email protected] (sung hoon oh)