How can I inlay a 3d model in a picture ?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

How can I inlay a 3d model in a picture ?

Post by rockn »

Hi all,
I have a project and I want to inlay a view of the model in a picture.
I know do it with gimp, but I can't get to have the right view to inlay it in my picture. I always have a wrong orientation or wrong point of view... Ther is a tip like "hold the picture in background of FreeCAD the time to check the right orientation of my point of view" ?
Do you have this already ? Have you an idea to make this ?
I mean something like that :
http://www.vertex-polygon.com/2012/projet-dextension
Formations - Assistance - Développement : https://freecad-france.com
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How can I inlay a 3d model in a picture ?

Post by jmaustpc »

Hi Rockn
I suspect you know this already,...but in case not this might help?

Go to Image workbench, select the 2nd icon from the left in the tool bar "create a planar image in 3d space"

Then go to the data tab and adjust the XSize and YSize parameters to scale it to your requirements. Adjust the placement to rotate it or move it.

Then when you have it looking correct with the model sitting as you desire, go to the tools menu in any workbench and select "save a picture", and it will save a JPEG image of what is shown in your model view...if that feature is supported with your GPU and its driver. If not then take a screen shot with a screenshot application.

I hope this helps. :)

Jim
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: How can I inlay a 3d model in a picture ?

Post by yorik »

Basically what you want to achieve is not easy, it's a photo integration.
To make it properly, normally, you need to know the position of the camera that took the picture, and its focal distance. If you have a picture taken with a digital camera, normally the focal length is written in its EXIF data (it is data embedded in jpg images, that can be read by a couple of applications, for ex. xnview). If you don't know, try with common focus lengths (50mm, 35mm, etc)

If you are going to shoot the photo yourself, simply note the exact position of the camera somewhere, it'll save you some work. If not, then you need to estimate.

I usually do that with blender, it is relatively easy to position the camera properly. You put the picture as a background image, you place the camera more or less where you feel it was in the real world, using the grid as ground plane. You can also model a couple of helper objects. Then you move the camera little by little until all the perspective lines of your ground plane and the helper objects fit perfectly with the background image.

Another method, if you have several photos of the same "scene", there are applications that can "recreate" the scene in 3D, so you can place the camera where you want. But the result is much less perfect, of course.

Anyway, this is really not something to do in freecad, because oyu need much more control over the camera (focla distance and precise placement). I think sketchup also has tools (or plugins) to do that...
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: How can I inlay a 3d model in a picture ?

Post by rockn »

Yes you are right.
Thanks Jmaustpc I haven't use Image workbench yet ;) But like Yorik says it's really hard to get the good position of both picture and camera relative the model.
Thanks.
Formations - Assistance - Développement : https://freecad-france.com
Post Reply