Automatically Mapping Image Texture to UV Maps For Custom Mesh? - python-3.x

I am trying to apply texture to 3D clothing model using openCV. I have the UV maps of the clothing model and an image of the texture I want to apply which I prepared using grabcut(). How do I deform the texture image to match my UV mesh using OpenCV or any other automated method. I am providing the input Texture Image and also the UV mesh of the clothing. I am new to 3D modeling and OpenCV and I am facing issues with this please help me out.
Input Texture Image
UV mapped mesh of 3D model
Similar query at this link here

Related

Coming from Computer Vision (CV), what is camera.matrixWorldInverse and camera.projectionMatrix in THREE.JS?

In computer vision the projection matrix contains the camera pose in camera space and the intrinsics of the camera. This will allow you to project 3D points on an image (x,y).
In THREE.js that is the projection matrix exactly ? When I print it, it is mostly a diagonal matrix.
I read that to get the projection matrix in THREE.js you have to do:
const matrix = new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse)
Is the camera.matrixWorldInverse the equivalent of a camera pose in CV and camera.projectionMatrix the equivalent of an intrinsics matrix ?
PS: in COLMAP for example the camera pose in camera space transforms a world point to camera space.

Random walker algorithm how a gray-level image can be 3D?

I was reading the source of the random walker algorithm in scikit-image library, and it's written there that:
Parameters
data : array_like
Image to be segmented in phases. Gray-level `data` can be two- or
three-dimensional
My question is: what do they mean by 3D gray-level image?
A 2D image is an image that is indexed by (x,y). A 3D image is an image that is indexed by (x,y,z).
A digital image samples the real world in some way. Photography produces a 2D projection of the 3D world, the digital photograph is a sampling of that projection. But other imaging modalities do not project, and can sample all three dimensions of the 3D world. For example:
Confocal microscopy
Computed tomography
Magnetic resonance imaging
Besides these, a 2D time-series (a movie) is sometimes also treated as a 3D image, applying algorithms that work on 3D images.

UV Projection of 3D shape onto 2D images

Given a 2D image of a human face and the corresponding 3D shape, how do I project the shape onto the images to extract texture patches from them to form a partial UV map?

Converting vertex colors to UV texture in meshlab

I am trying to write a script that converts the vertex colors of a scanned .ply model to a good UV texture map so that it can be 3D painted as well as re-sculpted in another program like Mudbox.
Right now I am unwrapping the model using smart projection in Blender, and then using Meshlab to convert the vertex colors to a texture. My approach is mostly working, and at first the texture seems to be converted with no issues, but when I try to use the smooth brush in Mudbox/Blender to smooth out some areas of the model after the texture conversion, small polygons rise to the surface that are untextured. Here is an image of the problem: https://www.dropbox.com/s/pmekzxvvi44umce/Image.png?dl=0
All of these small polygons seem to have their own UV shells separate from the rest of the mesh, they all seem to be invisible from the surface of the model before smoothing, and they are difficult or impossible to repaint in Mudbox/Blender.
I tried baking the texture in Blender as well but experienced similar problems. I'm pretty stumped so any solutions or suggestions would be greatly appreciated!
Doing some basic mesh cleanup in Meshlab (merging close vertices in particular) seems to have mostly solved the problem.

how to transform svg into 3D in three.js

I am building a floor map in svg, it is a 2D map, I am wondering how can I transform this map into 3d space using the three.js.
I am wondering is there any API in three.js help me to transform / render these svg into 3D

Resources