Jump to content

Matching camera to arbitrary image


Recommended Posts

Given an arbitrary image (like this one: Swanston Street - looking South - taken from Rooftop Bar), how would you go about even roughly matching the projection?

First, from the Flickr information, you can get the 35mm equivalent focal length which I can set in the camera node.

Next, I don't know any dimensions of anything on the image but (if it's useful) I can probably assume that the person taking the picture is somewhere around 175cm high.

Obviously from looking at the picture, I could choose 4 points that would be roughly square on the flat surface, so do I just set the picture as the viewport (and camera) background, create a grid and fiddle with the camera until it looks roughly right?

Obviously since I have no known dimensions, it'll never necessarily be perfect, but is there a more clever way to use information I can provide (like chosen points on the image I know to be in the same plane, or three points I know to be a 90 degree angle, or whatever) to improve the camera position?

Thanks for your help,

Stephen

Link to comment
Share on other sites

I would try to figure out how far off of the ground the photo was taken, make a ground plane, project onto the ground plane then fiddle with the camera rotations until the road looks right... that might work.

Link to comment
Share on other sites

Hey Stephen,

I dunno how the picture looks like (the link didn't work for me) but you probably will need a couple of dummy objects that you will use as reference.Such As a Grid for the road/Ground, a couple of Boxes for buildings and such... then you can start playing with the relevant parameters like the aperture, focalLength and the translations of the camera , you can also attach a null to the camera and use that as the Locator instead of tweaking the camera translation Parms.

cheers,

Selcuk

Link to comment
Share on other sites

Thanks for the replies. I used Image Modeler to get a pretty good setup. I created a couple of planes in it and exported them as FBX along with the camera.

Weird thing is, when you import that FBX into Houdini, it all looks great until you look through the camera, and then the planes are miles away and you've got to set the Focal length up to somewhere around 12000 to get anywhere near them.

I created another camera and put it in the same place as the one imported and then set it up from there and that looked ok. Dunno what's gone wrong with the FBX import... I tried importing the FBX in Maya and that looked right, so I guess it might be a bug or some option on import I'm not aware of.

In order to add anything to the image, I put in a plane and a box to test things. I guess because the camera isn't quite set up right, the projected image is skewed (as shown in the attachments). The only reason I'm trying to project it is that I need a surface there so I can drop shadows from the cube. I guess I'd be better using a shadow matte and comping it but I was hoping I'd be able to do it all in the render.

Thanks again for the help.

post-4939-124828911018_thumb.jpgpost-4939-124828911448_thumb.jpg

Link to comment
Share on other sites

Weird thing is, when you import that FBX into Houdini, it all looks great until you look through the camera, and then the planes are miles away and you've got to set the Focal length up to somewhere around 12000 to get anywhere near them.

I created another camera and put it in the same place as the one imported and then set it up from there and that looked ok. Dunno what's gone wrong with the FBX import... I tried importing the FBX in Maya and that looked right, so I guess it might be a bug or some option on import I'm not aware of.

In case it helps anyone else, the camera is corrected if you change the Camera's Screen Window Size value to 1 and 1

Edited by StephenW
Link to comment
Share on other sites

your problem is probably caused by a wrong aperture setting. to be short, the focal length of the lens doesn't enough in itself to calculate the field of view. the size of the imaging medium also had to be given. this is exactly what the aperture parameter does. set it to the horizontal size of the camera's sensor which made the picture in millimeters, or 36 if it was made onto standard Leica format film. dpreview.com is the site to gather that information if it's a digital still camera. if you only know a mysterious focal length multiplier than divide 36 by this number and you will get a more or less decent estimation of the imaging medium's size.

if you are interested in the details search odforce, somewhere i (and probably others) did a lengthier explanation of the matter.

hope this helps

bmt

ps.: the default setting is what makes the most confusion here. if i remember well it has been chosen so that an 50mm lens would give a 45 degrees fov. don't ask me why. the second is the name of this parameter, which is correct, but can be misleading.

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

your problem is probably caused by a wrong aperture setting. to be short, the focal length of the lens doesn't enough in itself to calculate the field of view. the size of the imaging medium also had to be given. this is exactly what the aperture parameter does. set it to the horizontal size of the camera's sensor which made the picture in millimeters, or 36 if it was made onto standard Leica format film. dpreview.com is the site to gather that information if it's a digital still camera. if you only know a mysterious focal length multiplier than divide 36 by this number and you will get a more or less decent estimation of the imaging medium's size.

if you are interested in the details search odforce, somewhere i (and probably others) did a lengthier explanation of the matter.

hope this helps

bmt

ps.: the default setting is what makes the most confusion here. if i remember well it has been chosen so that an 50mm lens would give a 45 degrees fov. don't ask me why. the second is the name of this parameter, which is correct, but can be misleading.

Hi, I know this post is old but I am driving crazy to have an accurate camera match, I have all the measurements (distance from object, from ground, from walls, tilt, lens) from the shooting. Then in Houdini I model in basic shapes the environment in real size and I created a camera with the measurements I got in shooting and it doesn't match as it should. I was then searching about aperture and indeed the name is misleading, I was looking how to figure out or calculate the aperture and I found this number "Sensor size: Full frame (36 x 24 mm)" for the camera I'm using "Canon 5D Mark II" and then I found this post where you mention something about "camera's sensor". Is the sensor size the aperture which houdini's camera needs?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...