Comments (8)
AH! I think the problem was related with the issue #78
Doing
ndc_points [:,1] *= -1
solved
Thanks for the help! And congratulations for this amazing work.
from pytorch3d.
@filipetrocadoferreira Do you mean for each pixel in the rendered image you want to know the position of the vertices?
from pytorch3d.
Basically, is applying the same transformations as the render to the 3D vertex and get their 2D location in the image.
from pytorch3d.
using cameras.transform_points() i get the points in 'screen' coordinate system, but to go from this to 2D pixel coordinates I'm having a bit of a trouble
from pytorch3d.
By 2D pixel coordinates
do you mean NDC coordinates in the range [-1, 1] or coordinates in the range x = [0, W], y = [0, H] where the image is of size (H, W)?
If you have a code snippet you can provide of what you are trying to achieve that would also be helpful.
from pytorch3d.
range x = [0, W], y = [0, H] where the image is of size (H, W)
This one.
I'm having trouble to go from NDC to image coordinates.
from pytorch3d.
Ok so the output of cameras.transform_points()
will be in NDC coordinates in the range [-1, 1]. If i understand correctly, from this you want to go to pixel coordinates in the range y: [0, H] and x: [0, W].
To do this you just need to do the inverse of this PixToNdc
function:
pytorch3d/pytorch3d/csrc/rasterize_meshes/rasterize_meshes_cpu.cpp
Lines 12 to 15 in f358b9b
i.e. In C++
float NdcToPix(int i, int S) {
// where S is the size of the dimension e.g. H or W
return ((i + 1.0f) * S - 1.0f)/2.0;
}
from pytorch3d.
@filipetrocadoferreira oh ok makes sense that the rendering problem was affecting your calculations! I will close this issue - please monitor #78 for updates on the rendering fix.
from pytorch3d.
Related Issues (20)
- can't install pytorch3d HOT 2
- Marching Cubes CUDA implementation generates face indices out of bounds HOT 2
- Rendering depth map with Pytorch3D vs Open3D HOT 2
- No module named 'pytorch3d.structures' HOT 1
- get error: IndexError: tensors used as indices must be long, byte or bool tensors HOT 3
- Joining a Batch of Scenes HOT 1
- Size Mismatch between tensors when rendering SMPL model HOT 3
- Very slow rendering for large mesh HOT 8
- ImportError: libc10_cuda.so: cannot open shared object file: No such file or directory HOT 7
- the use of the normals_packed() HOT 1
- pointcould render issue
- Trouble updating all pixels from texture that contribute to render HOT 1
- load_obj save_obj seems to modify the original obj (has anyone else seen this) HOT 3
- Could not build wheels for pytorch3d HOT 3
- ERROR: Could not build wheels for pytorch3d, which is required to install pyproject.toml-based projects | Suggested methods in Issue #1734 did not help HOT 5
- Potential IOU compute Bug in box3d_overlap HOT 9
- How to create a uniform TexturesUV by giving verts and faces? HOT 1
- torch3d consumes a lot of memory when loading obj's
- It looks like my camera's spatial Camera position has moved backwards, but plot_scene doesn't have the xyz parameter entered, am I parsing the camera parameters wrong? HOT 3
- Possibly insufficient preallocation in IoU3D algorithm implementation
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 pytorch3d.