airar-dev / Unity-AR-ColorMapping

Unity AR Colormapping for easyar,vuforia,maxstar, arkit, arcore
http://airar-oss.github.io
BSD 3-Clause "New" or "Revised" License
102 stars 33 forks source link
augmented-reality colormap region-capture unity3d


Logo

AR ColorMapping

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/airar-dev/Unity-AR-ColorMapping?color=4cc51e)](https://github.com/airar-dev/Unity-AR-ColorMapping/releases/) [![GitHub top language](https://img.shields.io/github/languages/top/airar-dev/Unity-AR-ColorMapping?color=1081c2)](https://github.com/airar-dev/Unity-AR-ColorMapping/search?l=c%23) [![GitHub License](https://img.shields.io/github/license/airar-dev/Unity-AR-ColorMapping?color=f48041)](https://opensource.org/licenses/BSD-3-Clause) [![GitHub Watchers](https://img.shields.io/github/watchers/airar-dev/Unity-AR-ColorMapping?color=4cc51e)](https://github.com/airar-dev/Unity-AR-ColorMapping/watchers) [![GitHub Repo stars](https://img.shields.io/github/stars/airar-dev/Unity-AR-ColorMapping?color=4cc51e)](https://github.com/airar-dev/Unity-AR-ColorMapping/stargazers) [![GitHub Forks](https://img.shields.io/github/forks/airar-dev/Unity-AR-ColorMapping?color=4cc51e)](https://github.com/airar-dev/Unity-AR-ColorMapping/network/members)
[![Unity Badge](https://img.shields.io/badge/-Unity3D_2022.3.4f1-000?logo=unity&link=https://unity.com/)](https://unity.com/) [![Visual Studio Badge](https://img.shields.io/badge/-Visual_Studio_2022-5C2D91?logo=visual-studio&link=https://visualstudio.microsoft.com/)](https://visualstudio.microsoft.com/) [![OS And Badge](http://img.shields.io/badge/-opencv_3.4.10_android_sdk-3DDC84?logo=Android&logoColor=fff&link=https://opencv.org/releases/)](https://opencv.org/releases/) [![OS IOS Badge](http://img.shields.io/badge/-opencv.framework-9f9f9f?logo=iOS&logoColor=fff&link=https://opencv.org/releases/)](https://opencv.org/releases/)


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

demo video


Table of Contents


Requirements

* As of August 3, 2021, the latest version of Unity3D and the latest version of each AR engine have been tested.

* As of July 21, 2023, the latest version of Unity3D and the latest version of each AR engine have been tested.

* As of July 29, 2024, the latest version of Unity3D and the latest version of ARFoundation have been tested.

* As of July 30, 2024, the latest version of Unity3D and the latest version of Vuforia have been tested.

* As of Aug 9, 2024, multi-tracking supported ARFoundation samples have been updated.


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))


3D Guide

https://youtu.be/2-h8aBLddjY

Quick Start

with MaxstAR

Create Android App Project Demo(https://youtu.be/JhixOsRKQ5k)
Create iOS App Project Demo(https://youtu.be/h3YQMaf7R-E)

 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' codeCheck the Allow 'unsafe' code
Scripting BackendSelect IL2CPP
Target ArchitecturesCheck Arm64 architecture(uncheck ARM7)
Scripting Define SymbolsAdd ‘USE_MAXSTAR’ into Scripting Define Symbols


 6. Player Settings for iOS

Allow 'unsafe' codeCheck the Allow 'unsafe' code
Scripting BackendSelect IL2CPP
Target ArchitecturesCheck Arm64 architecture(uncheck ARM7)
Scripting Define SymbolsAdd ‘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

masxtar-1

trackableBehaviour  MaxstAR ImageTrackableBehaviour
ARContents3D object to augment
RealWidthActual horizontal size of the marker image
RealHeightActual vertical size of the marker image


 9. Build
 - Build by selecting the MaxstARSample scene under ColorMapping -> Scenes.


with EasyAR

Create Android App Project Demo(https://youtu.be/elk7-E3LDYc)
Create iOS App Project Demo(https://youtu.be/bcKe0nKg5fg)

 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' codeCheck the Allow 'unsafe' code
Graphics APIsRemove Vulkan from the Graphic API list
Scripting BackendSelect IL2CPP
Target ArchitecturesCheck Arm64 architecture(uncheck ARM7)
Scripting Define SymbolsAdd 'USE_EASYAR' into Scripting Define Symbols


 6. Player Settings for iOS

Allow 'unsafe' codeCheck the Allow 'unsafe' code
Graphics APIsRemove Metal from the Graphic API list
Scripting BackendSelect IL2CPP
ArchitectureCheck Arm64 architecture(uncheck ARM7)
Scripting Define SymbolsAdd '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

easyar-1

ImageTargetController EasyAR ImageTargetController
ARContents3D object to augment
RealWidthActual horizontal size of the marker image
RealHeightActual vertical size of the marker image


 9. Build
 - Build by selecting the EasyARSample scene under ColorMapping -> Scenes.


with Vuforia

Create Android App Project Demo(https://youtu.be/b5zSwDiwE4Q)
Create iOS App Project Demo(https://youtu.be/s1TcKE2PzXk)

 1. Create Project
 - Create an empty Unity3D project.

 2. Import Vuforia Unity Package
 - Importing the Vuforia Engine AR Unity Package(9.5.4v +) and Vuforia Sample Package.

 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' codeCheck the Allow 'unsafe' code
Scripting BackendSelect IL2CPP
Target ArchitecturesCheck Arm64 architecture(uncheck ARM7)
Scripting Define SymbolsAdd 'USE_VUFORIA' into Scripting Define Symbols


 6. Player Settings for iOS

Allow 'unsafe' codeCheck the Allow 'unsafe' code
Scripting BackendSelect IL2CPP
Target ArchitecturesCheck Arm64 architecture(uncheck ARM7)
Scripting Define SymbolsAdd '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

vuforia-1

ImageTaget      Vuforia ImageTargetBehaviour
ARContents3D object to augment
RealWidthActual horizontal size of the marker image
RealHeightActual vertical size of the marker image


 9. Build
 - Build by selecting the VuforiaSample scene under ColorMapping -> Scenes.


with ARFoundation(ARkit, ARcore)

Create Android App Project Demo(https://youtu.be/nR0D5B6s6dA)
Create iOS App Project Demo(https://youtu.be/lzDVS_dOwV4)

 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' codeCheck the Allow 'unsafe' code
Scripting BackendSelect IL2CPP
Target ArchitecturesCheck Arm64 architecture(uncheck ARM7)
Scripting Define SymbolsAdd 'USE_ARFOUNDATION' into Scripting Define Symbols
Minimum API LevelAndroid 7.0(API Level 24)+


 6. Player Settings for iOS

Allow 'unsafe' codeCheck the Allow 'unsafe' code
Scripting BackendSelect IL2CPP
ArchitectureCheck Arm64 architecture(uncheck ARM7)
Scripting Define SymbolsAdd 'USE_ARFOUNDATION' into Scripting Define Symbols
Target minimum iOS Version11.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

arfoundation-1

ImageManager    ARTrackedImageManager
ARContents3D object to augment
RealWidthActual horizontal size of the marker image
RealHeightActual vertical size of the marker image


 7. Build
 - Build by selecting the ARFoundationSample scene under ColorMapping -> Scenes.


Release

Version New Features Date
 v1.3.7  multi-tracking supported ARFoundation samples have been updated.  2024.08.09 
 v1.3.6  the latest version of Unity3D and the latest version of Vuforia have been tested.  2024.07.30 
 v1.3.5  the latest version of Unity3D and the latest version of ARFoundation have been tested.  2024.07.29 
 v1.3.4  the latest version of Unity3D and the latest version of each AR engine have been tested.  2023.07.21 
 v1.3.3  Upload samples compatible with the latest version of Vuforia  2023.05.31 
 v1.3.2  Upload samples compatible with the latest version of Vuforia  2022.11.30 
 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


Trouble Shooting

 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


Contributing


License


Contact