I’m developing an augmented reality iPhone app.
What it should basically do is display pictures assigned to geographical locations when you look at them by the camera. Each such picture may be understood as a billboard which has its geographical position and a heading (understood as an angle between its plane and the north direction axis).
The goal is to make these billboards display more or less like they were physical objects. They should be larger if you are close to them and smaller when farther. They should as well appear in a proper perspective when you don’t stand directly in front of them.
I think I have achieved that goal more or less. By measuring the initial heading from the iPhone to a picture I can decide about the rotation angle of the pictures as viewed by the camera (to see them in a proper perspective).
However, if it comes to scaling them based on the distance from the phone, I think I screwed my approach. I made an assumption that the maximum view distanse is, let’s say, 200 m. Then billboards being 100 m from the phone are displayed in 50% of their original size. That’s it. A linear scaling based on the maximum distance.
What I missed by this approach is the size of billboards (understood as physical objects). The way they display on the screen depends on their size in pixels only. This means that the resolution of the display is a factor that decides how you perceive them. So I assume that if you get two phones with the same screen dimensions but different resolutions, the same pictures will be of different sizes on both of them. Am I right?
Then finally, my question is how to approach scaling pictures to make them look good on the AR view?
I think I should take some camera parameters into consideration. When a 10x10 cm object is just in front of the camera it may cover the whole screen. But when you put it a few metres farther, it becomes a minor detail. Then how to approach scaling? If I decide to assign physical dimensions to my virtual billboards, then how to scale them based on the distance from the camera?
Am I right that I should assign physical dimensions in metres to each picture (no matter what their size in pixels is) and display them based on the dimensions and some camera-dependent scaling factor?
Could you please help me on that? Any clues will be helpful. Thank you!