Git Product home page Git Product logo

Comments (7)

phelps-matthew avatar phelps-matthew commented on August 21, 2024 1

In case someone else will find this helpful.. I believe COLMAP follows the format of the projection matrix given as transforming 3D camera coordinates to world coordinates. Hence, to go from the above image as formed from W -> C transformation to this image,
image

try the following:

# Given 3x3 W -> C SO(3) matrix and r, the translation vector, form the correct 4x4 transformation matrix
# X_w = R^T X_c - R^T t (cam to world, what was needed)
# X_c = R X_w + t (world to cam, what I had before)                                                                                                                                                                                       
Rt = np.matmul(so3.transpose(), r)                                                                                                                                                                                                                                                                                        
trans = np.vstack((np.hstack((so3.transpose(), -Rt.reshape(-1, 1))), [0, 0, 0, 1]))

You can then view using python view_data.py <data_root>. All one needs is images, poses, and intrinsics that follow the above format (no bbox.txt or other files strictly needed).

from svox2.

povolann avatar povolann commented on August 21, 2024 1

I am little bit confused about the intrinsic matrix, shouldn't it be like this?

fx 0 cx 0
0 fy cy 0
0 0 1 0
0 0 0 1

from svox2.

sxyu avatar sxyu commented on August 21, 2024

Hi, thanks for the question.

If you want to use your own camera poses, you will have to process them our NSVF-based format, which is fairly simple anyway (see below). Other than proc_colmap there is also proc_record3d.py which processes captures from the iPhone app Record3D to our format; this might be a helpful example.

Currently svox2 itself only supports the pinhole model fx/fy/cx/cy.
The run_colmap.py script (called by proc_colmap.sh) actually estimates radial distortion parameters by default with COLMAP but will undistort the images. For simplicity, you can also use OpenCV to undistort your own images.

Format reference:

intrinsics.txt: 4x4 matrix,

fx 0 0 cx 
0 fy 0 cy
0 0 1 0
0 0 0 1

images/ or rgb/: images (*.png or *.jpg)
pose/: 4x4 c2w pose matrix for each image (*.txt), OpenCV convention

from svox2.

phelps-matthew avatar phelps-matthew commented on August 21, 2024

Thank you kindly! I may try undistorting all my images, though the distortion coefficients are very small here, so I'm going to ignore them for the moment.

I was able to get the nsvf dataset loader working after formatting my images and poses to the following convention (had to add in a conversion from grayscale to rgb)

<dataset_name>
|-- bbox.txt         # bounding-box file
|-- intrinsics.txt   # 4x4 camera intrinsics
|-- images
    |-- 0_000001.png        # target image for each view
    ...
    |-- 1_000001.png
    ...
|-- pose
    |-- 0_000001.txt        # camera pose for each view (4x4 matrices)
    ...
    |-- 1_000001.txt
    ...

I'll continue training and testing, granted there are quite a number of hyperparamers to adjust here, but hoping I can start to see the rough formation of my imaged object.

Do you know what convention rotation matrices are to follow for NSVF? Having a difficult time determining if my axes are aligned with its standard. For example, here is my distribution of camera poses

image

from svox2.

phelps-matthew avatar phelps-matthew commented on August 21, 2024

images/ or rgb/: images (*.png or .jpg) pose/: 4x4 c2w pose matrix for each image (.txt), OpenCV convention

Apologies, I totally missed this remark! Would have saved myself a headache 😂

from svox2.

qhdqhd avatar qhdqhd commented on August 21, 2024

how can i use views with different intrinsics (images captured by multi-cameras)?

from svox2.

LinGeLin avatar LinGeLin commented on August 21, 2024

what does <CHECKPOINT.npz> <data_dir> mean?

from svox2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.