# AR Building Visualization with Grayscale Filter

This project is the output from a master thesis for the MSc Photogrammetry and Geoinformatics programme of Stuttgart Technology University of Applied Sciences (Hochschule für Technik Stuttgart). The android application was developed in Unity (2020.1.9f1) with the ARFoundation SDK (v4.1.1) and the ARCore XR Plugin (V4.1.1). 

The app uses the **image tracking** method to detect buildings in Nordbahnhof, Stuttgart, Germany. Once the building is detected, the app will instantly turn the background and context into grayscale, leaving the building to be rendered in color. This visualization with AR is chosen as urban planners and designers often need to showcase their focusing urban feature with a reduced amout of information in the background. Using AR for the visualization can possibly bring more civil participation into the urban planning process.

![alt text](demo.gif "demo video")

The moving picture above shows the visualization of the app. The tracking and filtering happens in real time when the camera is pointed to a designated building.

# Assets

This repository shares the assets I used in the Unity Project to build the app. They can be use for reference to build apps with a similar scope.


1. **Scripts** stores the C# scripts for the app. The most important piece of code is _ImageTracking.cs_, which is added on top of the AR Tracked Image Manager API to allow it to track multiple images and spawn prefabs according to the filenames. _resets.cs_ reloads the AR session and scene, and is helpful for refreshing the tracking system.

2. **Texture** stores the reference images for building the reference image library.

3. **Prefabs** stores the building model prefabs that will spawn on top of the building once they are detected. It also stores the _reference image library_ for the image tracking system.

4. **Shaders** stores the shaders created for the grayscale filter visualiztion. _grabpass.shader_ is the grayscale filter used for the background and contexts. _StencilFilter.shader_ is for the buildings model to be left out of the grayscale filter rendering.

5. **Materials** stores the materials that wrap the shaders mentioned above.

# Concepts and Documentation

To read more about the concepts and documentation of the development of the app, click [here](https://transfer.hft-stuttgart.de/pages/huijustinjing/justin-hui_ar-visualization/home/) to find the full report.
