mkazhdan / PoissonRecon

Poisson Surface Reconstruction
MIT License
1.56k stars 425 forks source link

PoissonRecon error: Invalid faces #108

Open cdcseacave opened 5 years ago

cdcseacave commented 5 years ago

Thank you for this great algo and library. I'm new to it, and I'm facing an issue when using PoissonRecon. On relatively large point-clouds (~20M points) I get the following errors when I use a relatively high depth (>14):

[WARNING] c:\poissonrecon\src\femtree.initialize.inl (Line 220)
          FEMTreeInitializer<3,float>::Initialize
          Found bad sample nodes: 5844422
[ERROR] c:\poissonrecon\src\femtree.isosurface.specialized.inl (Line 1417)
        IsoSurfaceExtractor<3,float,class PlyVertexWithData<float,3,struct MultiPointStreamData<float,struct MultiPointStreamData<float> >,float> >::_SetIsoSurface::<lambda_67e6469a7a5232d9f00db12296b28e4e>::operator ()
        Invalid faces: 10440616  front
[ERROR] c:\poissonrecon\src\femtree.isosurface.specialized.inl (Line 1417)
        IsoSurfaceExtractor<3,float,class PlyVertexWithData<float,3,struct MultiPointStreamData<float,struct MultiPointStreamData<float> >,float> >::_SetIsoSurface::<lambda_67e6469a7a5232d9f00db12296b28e4e>::operator ()
        Invalid faces: 10440594  front

My understanding is that the algo uses an exhaustive octree to represent the intermediate scene so this error might be related to out-of-memory issues. My PC has 128GB RAM, so I am not sure though. Can you pls confirm?

If that is the case there are several solutions on my side (ex split the point cloud in chunks), but I am wondering if would be easy to adapt the code to exploit the sparsity of the input. The reason I am forced to use high depth is cause the scene has a large bounding box, but mostly a couple of small objects apart from eachother. So my guess is that current octree uses a dense representation, while there are maybe 3% occupied cells.

Thank you!

mkazhdan commented 5 years ago

Can you confirm that this problem does not occur at lower depths?

cdcseacave commented 5 years ago

does not

mkazhdan commented 5 years ago

If you are compiling the code yourself, can you go into the file PreProcessor.h and change "#undef BIG_DATA" to "#define BIG_DATA"?

cdcseacave commented 5 years ago

Thx for the tip, I did try, and now it does not crash anymore, but the generated mesh is total bobus:

image

instead of:

image

mkazhdan commented 5 years ago

Can you try the following:

  1. Run the reconstruction with the "--density" flag enabled.
  2. Run "SurfaceTrimmer --in --out --trim 8" If that doesn't work, can you share the dataset?
cdcseacave commented 5 years ago

I know what you say, but the above mesh is all you see, just 500 faces. However I run it several more times and I can not reproduce the problem, it worked fine. I was testing this all day, I'll try more datasets. I keep you updated.

happyfrank commented 3 months ago

Hi! @mkazhdan First of all, thank you for working on this great tool, much appreciated! 👍

I have a same issue. PoissonRecon version 16.01 Parameters: --in pcd_init.ply --out poisson.ply --pointWeight 1.0 --samplesPerNode 5.0 --depth 15 --density --colors

pcd_init.ply

[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6496 8324 1288 @ 14 | 1289 : 67087484 ( ([12992,12994],[16648,16650],2578)/32768 | (51973,66597,10312) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6497 8324 1288 @ 14 | 1289 : 67087485 ( ([12994,12996],[16648,16650],2578)/32768 | (51981,66597,10312) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6496 8325 1288 @ 14 | 1289 : 67087486 ( ([12992,12994],[16650,16652],2578)/32768 | (51973,66605,10312) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6497 8325 1288 @ 14 | 1289 : 67087487 ( ([12994,12996],[16650,16652],2578)/32768 | (51981,66605,10312) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6499 8325 1288 @ 14 | 1289 : 67087491 ( ([12998,13000],[16650,16652],2578)/32768 | (51997,66605,10312) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6499 8326 1288 @ 14 | 1289 : 67087497 ( ([12998,13000],[16652,16654],2578)/32768 | (51997,66613,10312) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6500 8325 1288 @ 14 | 1289 : 67087502 ( ([13000,13002],[16650,16652],2578)/32768 | (52005,66605,10312) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6500 8326 1288 @ 14 | 1289 : 67087508 ( ([13000,13002],[16652,16654],2578)/32768 | (52005,66613,10312) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6494 8311 1289 @ 14 | 1290 : 67088338 ( ([12988,12990],[16622,16624],2580)/32768 | (51957,66493,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6495 8311 1289 @ 14 | 1290 : 67088339 ( ([12990,12992],[16622,16624],2580)/32768 | (51965,66493,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6494 8312 1289 @ 14 | 1290 : 67088412 ( ([12988,12990],[16624,16626],2580)/32768 | (51957,66501,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6495 8312 1289 @ 14 | 1290 : 67088413 ( ([12990,12992],[16624,16626],2580)/32768 | (51965,66501,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6494 8313 1289 @ 14 | 1290 : 67088414 ( ([12988,12990],[16626,16628],2580)/32768 | (51957,66509,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6495 8313 1289 @ 14 | 1290 : 67088415 ( ([12990,12992],[16626,16628],2580)/32768 | (51965,66509,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6494 8314 1289 @ 14 | 1290 : 67088420 ( ([12988,12990],[16628,16630],2580)/32768 | (51957,66517,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6495 8314 1289 @ 14 | 1290 : 67088421 ( ([12990,12992],[16628,16630],2580)/32768 | (51965,66517,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6494 8315 1289 @ 14 | 1290 : 67088422 ( ([12988,12990],[16630,16632],2580)/32768 | (51957,66525,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6495 8315 1289 @ 14 | 1290 : 67088423 ( ([12990,12992],[16630,16632],2580)/32768 | (51965,66525,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6496 8311 1289 @ 14 | 1290 : 67088470 ( ([12992,12994],[16622,16624],2580)/32768 | (51973,66493,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6497 8311 1289 @ 14 | 1290 : 67088471 ( ([12994,12996],[16622,16624],2580)/32768 | (51981,66493,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6496 8312 1289 @ 14 | 1290 : 67088476 ( ([12992,12994],[16624,16626],2580)/32768 | (51973,66501,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6497 8312 1289 @ 14 | 1290 : 67088477 ( ([12994,12996],[16624,16626],2580)/32768 | (51981,66501,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6496 8314 1289 @ 14 | 1290 : 67088484 ( ([12992,12994],[16628,16630],2580)/32768 | (51973,66517,10320) )
[WARNING] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 302)
          _LevelSetExtractor<1,float,3,struct Point<float> >::SliceValues::addIsoEdges
          Invalid face: [6496 8315 1289 @ 14 | 1290 : 67088486 ( ([12992,12994],[16630,16632],2580)/32768 | (51973,66525,10320) )
[ERROR] e:\main\openmvg_cgaii\src\third_party\poisson\src\FEMTree.LevelSet.3D.inl (Line 1505)
        _LevelSetExtractor<1,float,3,struct Point<float> >::SetLevelSet::<lambda_83242e98b899495327526da8b1f4fa4a>::operator ()
        Invalid faces: 67088657  cross
mkazhdan commented 3 months ago

In PreProcessor.h, the default state for the pre-processor flag BIG_DATA is undefined. Have you tried #define'ing it? (It could be the case that at a reconstruction depth of 15, the BIG_DATA flag needs to be enabled.)