This repository provides Python implementation of KNN algorithm for point cloud models comparison by Chamfer distance
find_nearest.py
-- finds top nearest 3D models for target modelcompare.py
-- compares two 3D modelsshow.py
-- shows 3D model from specified point cloud filequick_run/
-- contains bash-scripts for quick running above scriptsmodels/
-- contains point cloud models
The Chamfer distance between two point cloud models U and V is given by the average of distances between each point u in U, and its nearest point v in V:
If we try to find closest diffused model for normal bunny model by running
python find_nearest.py models/normal/bunny.ply \
models/diffused/ \
-s 1000
we obrain next results:
K Nearest Models to models/normal/bunny.ply:
models/diffused/bunny_D02_L04.ply: 0.0021084902964208802
models/diffused/cube_D02_L04.ply: 0.004529813682506928
models/diffused/sphere_D02_L04.ply: 0.0054064578883468795
models/diffused/vase_D02_L04.ply: 0.029371351044122095
models/diffused/dragon_D02_L04.ply: 0.030610421838445444
Note that here we used only 1000 random points from original model (~30k points) for improving computation speed.
So above results mean that for subsampled target normal bunny model
this algorithm performed next ranking on proposed diffused models: