xnowbzhao / sapcu

Self-Supervised Arbitrary-Scale Point Clouds Upsampling via Implicit Neural Representation (CVPR 2022)
MIT License
37 stars 5 forks source link

Bug: dense.cpp hardcoded values lead to indexing overflow in large point clouds. #21

Open ashtanmistal opened 11 months ago

ashtanmistal commented 11 months ago

In main.cpp:

for (int i = 0; i < pnumber; i++)
    {
        fscanf(pointreader, "%lf %lf %lf", &po[i].xyz[0], &po[i].xyz[1], &po[i].xyz[2]);
        int ppp = floor(((po[i].xyz[0] + 0.5) / cell)) * boxsize * boxsize + floor(((po[i].xyz[1] + 0.5) / cell)) * boxsize + floor(((po[i].xyz[2] + 0.5) / cell));
        search.push(ppp);
    }

If the pnumber is larger than the hardcoded maximum values for the KDtree, it will a) continue to try to push points to search, and no error is raised; b) no assertions are created to prevent inputting a point cloud that happens to be larger than this maximum, and c) nowhere in the code or paper is the limitation stated that the implementation only works for small (<5000 points) point clouds.

xnowbzhao commented 11 months ago

Thank you for your issue, it is prefered to divided large point cloud into blocks and apply upsampling respectively, I've modified the readme to point this out.