Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS augmented reality with compass and location

I'm trying to develop a mini "Around Me" like using camera, compass and location. I would like to display place's images on my screen. For the moment I have my location and my orientation with compass. I would like to know how can I determine the position of the place I want to display.

Thanks for your help ;)

like image 289
Pierre Avatar asked Jun 27 '11 14:06

Pierre


2 Answers

Once you have relative distance and bearing, which you can determine from two points in the same coordinate space using algorithms found on this page, figuring out where a known coordinate is with respect to a known viewpoint is basically a perspective projection, the math is outlined on this Wikipedia article. The rotation of the camera is given by the compass, and the tilt by the accelerometer (the position is of course, GPS).

I'm trying to find a better document - there are a couple of extra things to consider - like the camera parameters etc, but this is a good starting point.

If it's too involved (like if you're not comfortable with rotation matrices) we can break it right down to the simple trig.

like image 70
dabhaid Avatar answered Oct 03 '22 16:10

dabhaid


The code in the iPhone ARKit project does this, and quite a bit more. While you may not be able to use their complete library, it is a great reference on the subject of augmented reality.

like image 44
RyanR Avatar answered Oct 03 '22 16:10

RyanR