0
$\begingroup$

I have a 3D model for an object, and I want to get textures for it from many photos of the object, like in the image shown:

enter image description here

Is there a way to do this automatically? I know I could sample textures from photos and manually adjust it on the model, but for a project I'm working on, I'd like it to work automatically like photogrammetry techniques.

By using feature detection, I can already get the position and rotation etc of the object and superimpose the 3D model over it, automatically. From this point, I'd like to project the image over the the model to effectively texture the model, and then repeat for all sides of the object. I'd like to be able to script this just using the data so that this can be repeated many times, however all the tutorials that I've found on this (like this one) use a lot of manual tweaking, and don't have the model position information I do.

Can anyone point me in the right direction here? I feel like this isn't an overly new or complicated process, I just don't have the keywords or jargon to find it!

Edit for future reference: Using an addon called Eyek has worked wonders for me so far. Regular texture projection using default Blender is just too cumbersome with too many issues

$\endgroup$
7
  • 1
    $\begingroup$ If the model is always a cuboid, and so this question is not another question on how to automatically create a 3D model out of a 2D picture, then the problem comes down to unwrapping the cuboid once and fitting the texture in the right UV spots on the image. So you just need to consistently position it, e.g. consistently position your camera when you make photos of the object… If you want the cuboids to have varying dimensions, all you need to do is to rescale photos to fit the image file, and you don't need to touch Blender setup. $\endgroup$ Jun 23, 2023 at 10:29
  • $\begingroup$ @MarkusvonBroady Unfortunately the objects aren't perfectly cuboid, they're routers so lots of fiddly bits sticking out. Ideally the camera wouldn't have to be consistently placed because the position info gives how the model is positioned and rotated from any angle $\endgroup$
    – Mark
    Jun 23, 2023 at 11:25
  • $\begingroup$ To clarify, I'm not trying to create a model from a 2D image! Just trying to figure out how to project an image of an object onto the object model (which has the same orientation and position as the object in the picture) to effectively texture the model :) $\endgroup$
    – Mark
    Jun 23, 2023 at 11:34
  • $\begingroup$ So either stencil brush or uv project from view. $\endgroup$ Jun 23, 2023 at 11:38
  • $\begingroup$ Ah, brilliant! Can these be automated in a script do you know? $\endgroup$
    – Mark
    Jun 23, 2023 at 11:46

1 Answer 1

0
$\begingroup$

If you have pictures of the objects from different angles, you can use Perspective Plotter (or fSpy, or equivalent) to match a camera to the perspective in the picture and use that viewpoint to paint your picture onto the 3D model using Texture Paint mode. UVs must exist on the object and each viewpoint will require matching a camera to it, although that is a rather quick process.

$\endgroup$
1
  • $\begingroup$ Unfortunately, I need to automate this process so I can't use manual perspective plotting. The project I'm working on is to take photos of a manufactured object, project that onto an existing 3D model, then unwrap the model via predefined UV map, and analyse the texture for defects in manufacturing. Therefore this whole process needs to be as automatic as possible! $\endgroup$
    – Mark
    Jun 23, 2023 at 13:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .