FangGet / BundleFusion_Ubuntu_Pangolin

a porting for BundleFusion working on ubuntu, with Pangolin as visualizer
Other
122 stars 32 forks source link

Failed to run example "Failed! Frames are not added into BundleFusion." #7

Closed manhha1402 closed 3 years ago

manhha1402 commented 3 years ago

Hi, Thank you for the great job. I have built this project successfully with the flag cmake VISUALIZATION=OFF ... When I run the example, frames are not added into BundleFusion. Do you have any idea what happened?

Screenshot from 2020-11-03 10-25-45 Thank you

FangGet commented 3 years ago

It's strange that it directly outputs "not added into BundleFusion" flag without any other log. See https://github.com/FangGet/BundleFusion_Ubuntu_Pangolin/blob/d3390f9017ddcdf31c69d65155ef356c4a5b2dd6/src/BundleFusion.cpp#L174 , this function will only return false on two conditions: 1) ConditionManager::shouldExit() 2)failed to get depth image. But both of these will output the problem log before output. Try debug this function carefully to see where is the cause.

manhha1402 commented 3 years ago

Hi, Sorry for the late reply. The error show after frame 12 with the error "INVALID FIRST CHUNK". That means m_siftManager->getNumImages() <= 1 in the function Bundler::invalidateLastFrame() does not satisfy. So the m_SIFTImagesGPU.size() <=1. So this problem due to my GPU. Is this correct? Do you know what is problem here? Screenshot from 2020-11-09 20-07-38

jhljx commented 3 years ago

When I changed another dataset from http://sun3d.cs.princeton.edu/data/hotel_sf/scan1/, I also encountered the same problem as shown above.

jhljx commented 3 years ago

I've fixed this problem. The reason is caused by the depth image of the SUN3d dataset. The normal depth image is totally dark, but we can see textures in depth images of SUN3d dataset. So we need to transform this kind of depth image into the standard form(totally dark image).

The transformation code is as follows:

import imageio
img = imageio.imread('0000.png')  # read a depth image with texture
img = (img << 13 | img >> 3)
imageio.imwrite('new_0000.png', img)

After this transformation, the BundleFusion program can run this dataset smoothly.