nianticlabs / simplerecon

[ECCV 2022] SimpleRecon: 3D Reconstruction Without 3D Convolutions
Other
1.28k stars 120 forks source link

Strange result of colmap data #21

Open weihaosky opened 1 year ago

weihaosky commented 1 year ago

Hi, great work!

I am trying to reconstruct a small room. The camera poses and intrinsics are obtained from Colmap. Using the colmap dataloader from the repo, I only get a strange result as below: image

Could you figure out where the problem is? Many thanks!

Morpheus3000 commented 1 year ago

Hi, I had similar problems. For my case, turned out, the pose provided by colmap was already inverted for some reason. Inverting the poses from colmap again and then feeding it to simplerecon solved for me.

pablovela5620 commented 1 year ago

@Morpheus3000 could you give a bit more details as to what you mean you needed to invert poses provided by Colmap and exactly what you did? I'm having a similar issue. My depth/normals look reasonable, but like weihaosky, my mesh is a mess.

image

https://user-images.githubusercontent.com/25287427/215226339-8c7de4f7-8d97-4ac6-a896-e8fbddbf285b.mov

qweqwasdazE commented 1 year ago

Hello, I also plan to use this project and use colmap to calculate posture. There was a problem with posture when I tried Neural Recon before. It seems that this project cannot directly use the posture exported from colmap. Have you found a solution yet

carlosedubarreto commented 1 year ago

Hi, I had similar problems. For my case, turned out, the pose provided by colmap was already inverted for some reason. Inverting the poses from colmap again and then feeding it to simplerecon solved for me.

Sorry to bother @Morpheus3000 , as @pablovela5620 I'm a bit lost on how to make the colmap data to work. I'm on it for 2 days trying to make it work.

Can you give some more information on how to invert the data? I tried to inver the intrinsic using numpy (np.linalg.inv) but didnt make much difference on the final result.

The inver poses, you mean by invert the quaternions and translation data from each image that is stored on the "images.txt" file?

Thanks a lot for the help

Morpheus3000 commented 1 year ago

@Morpheus3000 could you give a bit more details as to what you mean you needed to invert poses provided by Colmap and exactly what you did? I'm having a similar issue. My depth/normals look reasonable, but like weihaosky, my mesh is a mess.

image

colmap-conference-room-2-480.mov

Hi, I had similar problems. For my case, turned out, the pose provided by colmap was already inverted for some reason. Inverting the poses from colmap again and then feeding it to simplerecon solved for me.

Sorry to bother @Morpheus3000 , as @pablovela5620 I'm a bit lost on how to make the colmap data to work. I'm on it for 2 days trying to make it work.

Can you give some more information on how to invert the data? I tried to inver the intrinsic using numpy (np.linalg.inv) but didnt make much difference on the final result.

The inver poses, you mean by invert the quaternions and translation data from each image that is stored on the "images.txt" file?

Thanks a lot for the help

Hello all,

For me just inverting the pose (using the inverse) on the poses saved by colmap worked. So I assumed simplerecon expects the colmap poses to be inverted.

carlosedubarreto commented 1 year ago

@Morpheus3000 Thanks a lot, I'm getting crazy trying to find out how to invert. it would be to inver the quaternions only or also the tranlation data?

If I'm not asking too much, can you point a direction, or something that you've found on how to invert it?

I was thinking on trying to convert the quarterion + translation to a transform matrix, invert it and then try to split it again into quaternion and translation.

That was what you've done?

Sorry to bother with that, I'm 4h today just trying to invert the data 😅

Morpheus3000 commented 1 year ago

@carlosedubarreto Hi, no problem. Getting stuff running is an experience I have had a lot haha.

For the inversion, I just inverted the pose matrix. I didn't need to convert to quaternion. That solved the issue for me.

carlosedubarreto commented 1 year ago

@Morpheus3000 Thanks for the help.

I tried to invert the data that was on the cameras.txt file, the part of the fx,fy,cx,cy.

I took that data, put into a matrix, inverted that, put the data back on the cameras.txt file, passed through the split data and procssed it.

The result just moved a few centimeters, but overall the result was still terrible. From what you say you inverted the pose matrix, do you remember where this pose matrix is?

It would be to invert the data for each image that is on the images.txt? From what i saw , in that file there is the quaternion and translation data for each image.

You said that just inverted the pose matrix, i dont know where it is. Do you remember if it was from a colmap result that you had this pose matrix?

What you said seemed to be actually very simple i just dont have any idea where that data would be. I couldnt find it on the colmap results

Morpheus3000 commented 1 year ago

@carlosedubarreto Hmmm you are inverting the camera intrinsic matrix. You could convert the quaternion and translation to the pose matrix and invert that. I don't exactly remember what I did, but I remember using some libraries to do the conversion.

carlosedubarreto commented 1 year ago

Thanks a lot @Morpheus3000 that makes very much sense to me.

Ill try your suggestion and post the results

carlosedubarreto commented 1 year ago

I've inverted but the result got much worst.

at first my result was this image

after inverting the poses, it became this image

I'll send the code that I was able to make in case anyone wants to try to improve. I think I'll giveup I dont know what else to do

But thanks a lto for all the suggestions @Morpheus3000 , really appreciated

invert_pose_colmap.zip

daniyar-niantic commented 1 year ago

Hi. Have you verified that the colmap reconstruction looks correct?

carlosedubarreto commented 1 year ago

@daniyar-niantic, Thanks for the messagem, I actually dont even remember what I've done. I gave up on that.