Git Product home page Git Product logo

Comments (6)

teachyourselfcoding avatar teachyourselfcoding commented on July 30, 2024 1

Hi, thank you for your work. Currently, I have these three files: cameras.bin/txt, cameras.bin/txt, poses3D.bin/txt. These 3 files contain all the data for my images. It seems from your previous reply that you are using individual.txt file for each image (/pos_{1}.txt'), can you provide me with any advice on how to obtain cameras.npz file? Thanks for you time~!

from idr.

teachyourselfcoding avatar teachyourselfcoding commented on July 30, 2024

+1. Any chance of how to obtain the .npz file? Been searching around everywhere for a solution for this.

from idr.

lioryariv avatar lioryariv commented on July 30, 2024

Hi,
Yes, the normalization code of the cameras is acting on cameras.npz file. For DTU, this npz file is a simple parsing of the txt files, meaning:

cameras = {}
n_cameras = 49 # or 64
scan_folder = 'DTU_preprocessed/scan65'
path_to_dtu_cameras = 'DTU/SampleSet/MVS Data/Calibration/cal18'
for i in range(n_cameras):
    filename = '{0}/pos_{1}.txt'.format(path_to_dtu_cameras, '%03d' % (i + 1))
    lines = open(filename).read().splitlines()
    lines = [[x[0], x[1], x[2], x[3]] for x in (x.split(" ") for x in lines)]
    P = np.asarray(lines).astype(np.float32).squeeze()
    P = np.concatenate([P, [[0, 0, 0, 1]]], 0)
    cameras['world_mat_%d' % i] = P
np.savez('{0}/cameras.npz'.format(scan_folder), **cameras)

And maybe you'll need to make this code compatible with your pathnames.

from idr.

derrick-xwp avatar derrick-xwp commented on July 30, 2024

Do we need to process the downloaded camera parameters in DTU dataset first before converting them to npz files?

from idr.

lioryariv avatar lioryariv commented on July 30, 2024

As can be seen in the code in the previous comment, the only thing that needs to do to the camera parameters is to make them 4x4 instead of 3x4.

from idr.

siyangbing avatar siyangbing commented on July 30, 2024

嗨,谢谢你的工作。目前,我有这三个文件:cameras.bin/txt、cameras.bin/txt、poses3D.bin/txt。这 3 个文件包含我的图像的所有数据。从您之前的回复看来,您对每张图片都使用了 individual.txt 文件(/pos_{1}.txt'),您能给我提供有关如何获取 camera.npz 文件的任何建议吗?谢谢你的时间~!

I have the same question , can you help me

from idr.

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.