Facing Aware Camera

Jan. 27, 2018

by Viktoras Brasas, Senior developer at Xplicity


1. Introduction 
2. The Idea 
2.1. World Model
2.2. Sensors
3. Implementation 
3.1 Sensors reading
3.2 Value Wrapping
3.3 Virtual Model
3.3.1 Augments
3.3.2 World Model
3.3.3 Projecting world model onto screen space
3.4 Visualization
3.4.1 WPF Tree
3.4.2 Code behind
3.4.3 Camera capturer
3.4.4 Augmented camera
3.4.5 Visualizer workings
4 Considerations, Limitations and Improvement points 
4.1 Cylindrical model
4.2 Compass sensor data acquisition improvement
4.3 Spatial positioning
4.4 Camera center VS screen center
4.5 Magnetometer calibration
4.6 Camera angles
Ending Notes 


This article shows how to implement a camera that has a way to determine the direction it is facing and build upon this data to enhance the user experience.
We use various sensors (namely accelerometer, magnetometer\compass and gyroscope) to determine current positioning of the device. Elements can then be added to captured camera frames thus adding Augmented Reality dimension to the application. The article targeted to Windows Phone platform (8.1 and up). However, can easily be ported to other platforms like Android and iPhone and if Xamarin is employed in the process this should in theory mean minimal code changes. This revision also introduces gyroscope sensor and complementary filtering which help in getting accurate and noiseless sensor reading that can be reliably used by the world model.

Together with a full paper you will receive sample project.

Share this: