Author Topic: [RESOLVED] Camera Match - Interpolate Viewing Position  (Read 2515 times)

2020-10-07, 12:01:25

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
« Last Edit: 2020-10-07, 22:50:07 by cjwidd »

2020-10-07, 16:33:22
Reply #1

nauticus25

  • Active Users
  • **
  • Posts: 63
    • View Profile
Your question: Given two cameras in different XY locations along the same local Z axis, can you adjust the settings in one to match the view of the other?

Short answer: No.

Medium answer: Not really. You can adjust the field of view of one so that the edges of the view are at just about the same spot (the cones of each camera intersect the walls in the same spot), but the sizes of objects in frame and their location in relation to each other will not match. 

Longer answer: I think you might be trying to solve a different problem than the one you should be trying to solve. In your video, I didn't see the actual photo you're trying to camera match. But if your model is accurate, then your 3D camera should be exactly in the same place as the real camera when the photo was taken. Presumably, that should be inside the room. If it isn't in the same spot, you don't have an accurate camera match.

For an accurate match, you need the physical location and orientation of the camera as well as the focal length of the lens and the camera's sensor width.



You could get dial in the accuracy even more by capturing a distortion map with your specific camera to match barrel distortion with wide angle lenses (or play with the distortion amount in the Max camera), but I've found that location/orientation/focal length/sensor width get me close enough.

The other important detail with a camera match is that your backplate photo must not cropped/rotated. Render your image and composite it with the backplate first, then crop afterwards.


i9-12900K @ 3.2GHz, 64GB RAM, 3090ti
Max 2024, Corona 10

2020-10-07, 22:37:02
Reply #2

sprayer

  • Active Users
  • **
  • Posts: 794
    • View Profile

2020-10-07, 22:49:34
Reply #3

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
Yeah, without metadata from the source photo, I did a camera match based on the perspective match tool only. I think you're right though @nauticus25, the problem is unconstrained. If the XY coords weren't also changing, I think it would be possible.

2020-10-08, 00:26:24
Reply #4

mferster

  • Active Users
  • **
  • Posts: 523
    • View Profile
You are also assuming that the photo you are trying to match is in fact a full frame photo and not a photo that has been cropped and edited after the fact.

If it has has been cropped you will get different camera setting results than what you are expecting.

*edit: Also is there any particular reason why you aren't just using camera clipping if you are ultimately just trying to see through a wall?

2020-10-08, 01:48:11
Reply #5

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
Yeah, the question as I outlined in the video really isn't about perspective matching, as it is about calculating lens properties to generate an identical.image for two cameras at different positions.

I talked about how I knew there were other more practical solutions - which I ended up doing - but I was just curious if it were possible.