jiepengwang / NeuRIS

MIT License
227 stars 16 forks source link

The depth of the openMVG/openMVS output is incorrect #6

Closed LiXinghui-666 closed 1 year ago

LiXinghui-666 commented 2 years ago

Thank you for your excellent work. However, during the preprocessing of my own data, a shape error occurs in

depth0 = np.load(path_depth0).reshape(size_image[1], size_image[0])

The shape of path_depth0 is 518400(540960), but the shape of size_image is (10801920),How can I fix this part of the error?

jiepengwang commented 2 years ago

Hi, do you change the value of original_size_img and cropped_size_img according to your own data? (https://github.com/jiepengwang/NeuRIS/blob/7c085b2bd293e61ef7f8655fa1f13e733bbd5ba8/exp_preprocess.py#L53)

LiXinghui-666 commented 2 years ago

Yes, I'm sure to change the value of original_size_img and cropped_size_img according to my own data.The output results of ply, cropping images, and pose are correct, but there are errors in the depth, which puzzles me.

jiepengwang commented 2 years ago

I'm not sure where is wrong. Does the width and height of cropped_size_img satisfy the ratio 4:3? A minor suggestion is that maybe you can track the change of depth map size when running the program and find where is wrong.

MY-Park commented 2 years ago

Hi, thank you for your excellent work! :)

I also met the same error while preprocessing my own data, and finally got rid of the error after making

original_size_img = (960, 720)
cropped_size_img = (960, 720)

However, still I'm wondering why only the preprocess works on this size.

LiXinghui-666 commented 2 years ago

I'm not sure where is wrong. Does the width and height of cropped_size_img satisfy the ratio 4:3? A minor suggestion is that maybe you can track the change of depth map size when running the program and find where is wrong.

my cropped_size_img is(1360,1020), satifing the ratir 4:3.

original_size_img = (1920, 1080)
cropped_size_img = (1360, 1020) 
MY-Park commented 2 years ago

I fixed the issue by

  1. making image file indices as the format the author gave. ex) 0000.png, 0001.png, ... 0300.png
  2. fix NeuRIS/preprocess/sfm_mvs.py > def select_depths
    to resize depth_curr from 960 720 to 1920 1440 (same size with the images)
lxxue commented 1 year ago

After digging for a while, I found you can set the reso_level to 0 so openMVS won't scale down the image (reso_level=1 means scaling down the image by 2 in both dimensions, while in the training code reso_level=1 means keep the original resolution): https://github.com/jiepengwang/NeuRIS/blob/74187e6dfb14636b0d55fda09fb4ab85a791fb2f/exp_preprocess.py#L55 Also, you need to remove the assert here: https://github.com/jiepengwang/NeuRIS/blob/c07a3bd780fcb0b60f5e093d5a5ba4206f8a2fca/preprocess/sfm_mvs.py#L205