# Picture in Picture with distance in perspective

I have two cameras with the same specifications placed one in front of the other level and horizontal. I know the distance between them and the height of each camera. I want to create a picture-in-picture so that when image B (from camera B) overlaid on image A (from camera A), the distance between the two cameras is taken into account.

Theta and gamma are camera B image size in pixels. Alpha and theta are camera B image when overplayed on image A.

For example, if camera B has 800x600 (theta and gamma) pixel resolution and the distance between the two cameras is 50 meters, then alpha and beta is 400x300 pixels and image A from camera A is 800x600.

I can overlay image B on image A and have a picture-in-picture. Is there a way to relate the distance between the cameras when showing both images picture-in-picture?

• Are you trying to make a StarTrek cloaking device? – Stan Sep 22 '17 at 19:41
• Howdo you want to take the distance into account in your overlay? Do you mean you want to correct for perspective? Or are you just trying to get the magnification to roughly line up? What is the goal of this whole setup? – mattdm Sep 24 '17 at 7:51
• There is a wall between the two cameras. I want to do this to multiple cameras at different distances. I will combine all cameras' images into one image but for now i want to solve it for two cameras only. – H.A Sep 24 '17 at 18:40
• Please move this condition regarding the obstruction to the question. It is an important detail. After you add the detail to the question, delete the comment. – Stan Sep 24 '17 at 19:09

I think you are saying that you want to take a picture of a camera? The formula for magnification is that the ratio of the distance in front of the lens to the distance behind the lens (the focal length), is the same ratio as the image size of the subject (meaning the field of view) to the camera sensor size.

More handy, there is a calculator for this at https://www.scantips.com/lights/fieldofview.html For this use, use option 5, and enter your desired field of view, and your sensor and lens specifications.

However at very close macro distances, it gets complicated, and loses accuracy, because the distances in front of, and behind the lens, are measured to the principle points, probably inside the lens an inch or two, probably unknown to us.

But it doesn't really matter, because you wouldn't really measure distance to do this. That is just a starting point then, and you would instead simply judge the expected photo result by seeing the preview image on the cameras real LCD... adjusting distance or zoom to make it look like you want it to look. Simply just take a picture of it.

• Sorry, the full opposite of more clear. What is the question? What is &Alpaha; and &Beta;? Do they represent the red camera B image? If so, that needs much more info, including camera B focus distance and focal length and sensor size to know size of &Theta; and same for A also. If you know size and distance of &Theta; and &Upsilon;, and also camera A distance and focal length and sensor size, then &Beta; is some percentage of camera A total field of view. This is rhetoric, I'm never going to get this. Nice drawing though. – WayneF Sep 22 '17 at 19:19

You question is too convoluted for me – I can’t understand what you want to know.

When you say “project, are you talking about the fact that a camera lens projects an image onto the surface of the imaging chip? Or are you taking about using a digital projector to image on a screen?

Anyway: The magnification of a camera is defined as the size of the image divided by the size of the object being photographed. Thus is an object is 1000mm height and images 10mm height M = 1000 ÷ 10 = 100. Because the image inside the camera is a reduction, we label this as M = -100X.

p is the traditional symbol for object distance (camera to object). q is the traditional symbol image distance (lens to imaging chip) m is the traditional symbol for magnification

q ÷ p = m

Suppose p = 5000mm (5 meters) Suppose a 50mm is used than q = 50mm

Then: m = p/q

m = 5000/50 = 100 (written as -100X)

• Use the focal length setting of both cameras as q. Use the camera to subject distance as p. Do the math to solve for m for the furthest camera. Adjust the forward camera's subject distance and focal length to duplicate m realized by the most distance camera. – Alan Marcus Sep 22 '17 at 20:46
• thanks for your answer. I have updated my question to make it clearer. Can you please elaborate – H.A Sep 24 '17 at 1:24