Comments (7)
If you look at how we are computing the orthographic projection:
def orthographic_projection(X, camera):
"""Perform orthographic projection of 3D points X using the camera parameters
Args:
X: size = [B, N, 3]
camera: size = [B, 3]
Returns:
Projected 2D points -- size = [B, N, 2]
"""
camera = camera.view(-1, 1, 3)
X_trans = X[:, :, :2] + camera[:, :, 1:]
shape = X_trans.shape
X_2d = (camera[:, :, 0] * X_trans.view(shape[0], -1)).view(shape)
return X_2d
You can see that the first coefficient in the camera is the scaling factor whereas the second and third the translation in the x and y direction. So more formally, the transformation we are doing is
[X,Y,Z] -> camera[0] * [X+camera[1], Y+camera[2]]
I hope this helps
from graphcmr.
Thanks for the fast reply.
This in fact helps alot.
from graphcmr.
Hello, I can't figure how to use the predicted camera parameters in order to project the predicted points of the model onto the image.
Actually I want to make my intention clear. Given this camera parameters and the predicted SMPL model, is it possible for me to project every point of the mesh to the image? How is it done?
As I understand, this is handled by OpenDR.
Thanks in advance.
from graphcmr.
The orthographic projection function that I mentioned above projects the mesh in the normalized image plane. If you want to do the projection in pixel coordinates, you have to convert the projected coordinates from [-1,1] to [0,224] by a simple translation and scaling.
You can also do the perspective projection from scratch as K * [R,t] * [X,Y,Z]
as we show in demo.py
. Assuming a fixed focal length, first we get the camera translation
camera_translation = torch.stack([pred_camera[:,1], pred_camera[:,2], 2*FOCAL_LENGTH/(224 * pred_camera[:,0] +1e-9)],dim=-1)
This is t in the above projection equation. R will be the identity matrix and K will be
FOCAL_LENGTH 0 224/2
K = 0 FOCAL_LENGTH. 224/2
0 0 1
from graphcmr.
Thanks once again for the helpful response. Closing it, for now...
from graphcmr.
Hi,
Can you tell me how you arrived at the tz
term in the translation expression
camera_translation = torch.stack([pred_camera[:,1], pred_camera[:,2], 2*FOCAL_LENGTH/(224 * pred_camera[:,0] +1e-9)],dim=-1)
? It would be helpful if you could explain the reasoning.
from graphcmr.
Same question. If you have any mathematical solution, please let me know, thank you.
from graphcmr.
Related Issues (20)
- How to train model with human3.6m datasets HOT 1
- Preprocess of ground truth keypoints_3d on Human3.6M HOT 1
- question when I read the code HOT 1
- questions about "mesh_downsampling.npz" HOT 1
- Regarding fully connected baseline HOT 4
- Compute 'A', 'D', 'U' matrices HOT 6
- How to get 3d joints from demo.py and visualize it HOT 3
- About the SMPLParamRegressor
- Praise from a newbie HOT 1
- Why do you use different focal length for training and inference?
- Running βdemo.py' can't get good results HOT 2
- The problem of camera parameter βscβ HOT 1
- Loading Resnet50 pretrained?
- Asking for the weight of losses
- how to retrain this model in a new dataset with the real SMPL model
- preprocess datasets of h36m.py
- run demo.py
- wrong mesh volume
- The additional files could not be obtained.
- Pretrained model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphcmr.