/NeRF

Train your own dataset with NeRF

Primary LanguagePython

1. Photo processing

process
|-- input
    |-- 0.jpg
    |-- 1.jpg
    ...
|-- output
|-- template
    |-- template.jpg

The sample dataset is here.

Use the template matching method matchTemplate in opencv to intercept the roi.Before and after comparison is as follows:

python image.py --image_dir ./process/input --output_dir ./process/output --template ./process/template/template.jpg

input

output

2. Use colmap

Check out this blog.

3. Format conversion

Step1

python img2poses.py --scenedir ./result 

After running the commands above, a sparse point cloud is saved in result/sparse_points.ply. Sparse Points

Step2

Use meshlab to define roi.Refer to this blog. Save it as result/sparse_points_interest.ply. Sparse Points interest

Step3

python gen_cameras.py

Then the preprocessed data can be found in result/preprocessed.

Success! 🎉 🎉 🎉