Using wallpaper for photo-matching - options for opacity & depth?

I want to match my model to a photo. The model is of a very curvy non-rectilinear object, so “matching perspective” using vanishing points isn’t suitable. I want to set a camera and target, and then manipulate with focal length, panning, rotation and zoom until I get an accurate match to the photo. The photo is not set as a background image, but as wallpaper. There’s various youtube videos on this, it’s a well established technique. But that’s just an explanation of the context, it’s not the problem.

The issue is that I can’t find a way to set the wallpaper image in front of the object and then set its transparency, so that the model will show through from behind the image. I don’t believe it’s an option in standard Rhino. But perhaps someone has written a script to do it? This ability is a standard option in Blender (Camera object data properties > Depth and Opacity fields).

Without these two options, in Rhino you can only really use the wallpaper technique if you display your model in wireframe. That’s because in Rhino the background image is always set behind the model, and so wireframe display is the only way to see both image and model simultaneously, without the model obscuring the image. But if the model is complex, there are too many ‘wires’ to see through well. Much nicer to set to a shaded view, and look at it through a transparent photo image that is set in front of the model.

Is it possible?

It is not possible with current Rhino by itself.

But perhaps as a simple plug-in that draws in a conduit it could be done.

Thanks Nathan.
You mean this conduit?
https://www.food4rhino.com/en/app/conduit

I was thinking of Rhino - Display Conduits

I see now. Writing a plug-in within that is outside my skillset due to the steep and specialized learning curve and my lack of background coding knowledge. But it might align with someone else’s skills and objectives.

@Ian Use Picture command, not Wallpaper to show the image in Rhino. The size, position, orientation and transparency of the Picture object can be set as desired. (PictureFrame in Rhino 5 and earlier).

The problem is that the picture object (plane with material) will also visually change in your perspective view when you adjust the camera settings (location, rotation, target, lense length). This makes it unsuitable for perspective matching.

The ability to change how the image changes in perspective view depending on camera location, etc is exactly what @Ian is seeking:

To match an object to an image in perspective view the the observing camera position and direction must match the relative position and direction of the camera when the image was created. If the observing camera is in any other location or pointing in any other direction the object cannot match the image.

The fundamental difficulty is usually determining the location and direction of the creating camera. For non-orthogonal objects, partcularly objects without straight edges this can be very difficult to determine.

Capture more photos and use photogrammetry to create a 3D model…

@martinsiegrist – indeed if I were dealing with an existing object, photogrammetry would be an attractive method. But all I have is photos from the 1920 to 1936 period, and alas the subject is long gone. So photo-matching it is.

@davidcockey – so I tried the Picture command (Surface > Plane > Picture), and I see that what it does is to set up a surface within 3D space which has the image rendered onto it. If in perspective view the orientation axes are altered, the image itself is treated as an object projected with perspective. That means that if I adjust the orientation of the 3D model, the image too alters its perspective. With Wallpaper, that does not happen, and that’s a good thing, because then it is possible - in theory - to orient the model to exactly coincide with the image. Various Youtube videos demonstrate the idea, for example " [VRay for Rhino] Photo Perspective Match", https://www.youtube.com/watch?v=451rQR_FRPw . Admittedly, the various videos there are all rather long-winded and all add their own “special sauce” (e.g., you don’t need V-Ray as in the video I cited, and you don’t need to Photoshop distort the image into 2D perspective as another video does). But the basic principle is there. Import the image as Wallpaper, set up the 3D model in front, and then pan, zoom, rotate and play with focal length until you get a fit.

Actually, the best – most sophisticated – version of this approach was developed by Witold Jaworski for Blender. He describes it in his pdf book “Virtual Airplane” Vol.2, but also describes it in two pdfs on his blog, back in 2019:

I have been using his process with some success. In Blender, each camera can be set up with its own background image – the equivalent of Wallpaper in Rhino. The extra sophistication in Jaworski’s method are to couple the camera to a target using a “Track To” constraint, which provides the ability to adjust both the camera location and the direction of its view axis (which has the effect of x-y adjustment in the picture plane, independently of the camera location). Rhino can sort of do that too. He also wrote a script that adjusts the camera distance automatically when the focal length is changed, to save the time and effort of manually re-adjusting the camera distance from the object, and that is very nice to have although not essential. The biggest deal is that Blender, as I noted in my earlier post above, has the simple but very necessary ability to adjust the depth and opacity of the photo image (i.e. to place the image in front of the model, and adjust opacity to be able to see through the image to the model). Now we know from this post that Rhino, so far, can’t do that.

I have to continue using Blender instead of Rhino (I kind of have to because of Rhino’s too-basic option for Wallpaper), but since my model is in nurbs and Blender is mesh (I prefer nurbs), it’s a lot of to-and-fro round-trips using Nathan’s Rhino-to-Blender importer one way, and a doppelganger mesh model going back the other way, to iterate to the final product. It’s a pity that for now, Rhino’s wallpaper can’t be adjusted in those two ways – depth and opacity; otherwise I would adapt Jaworski’s method to Rhino.

2 Likes