diff --git a/scanner/scanner.c b/scanner/scanner.c index d301a57..e9397e1 100644 --- a/scanner/scanner.c +++ b/scanner/scanner.c @@ -188,11 +188,11 @@ long int DBSCAN(Face **ppFaces, long int faceCount, double eps, int minPts) { FaceLink *pNeighbors = RangeQuery(ppFaces, faceCount, pFace, eps); long neighborCount = chainLength(pNeighbors); while (neighborCount > minPts * 5) { - fprintf(stderr, "\nWith eps of %f, %ld has %ld neighbors.", threshold, pFace->faceId, neighborCount); threshold *= 0.9; freeChain(pNeighbors); pNeighbors = RangeQuery(ppFaces, faceCount, pFace, threshold); neighborCount = chainLength(pNeighbors); + fprintf(stderr, "With eps of %f, %ld has %ld neighbors.\n", threshold, pFace->faceId, neighborCount); } if (neighborCount < minPts) { @@ -228,12 +228,13 @@ long int DBSCAN(Face **ppFaces, long int faceCount, double eps, int minPts) { FaceLink *pSubNeighbors = RangeQuery(ppFaces, faceCount, pQ, eps); neighborCount = chainLength(pSubNeighbors); + threshold = eps; while (neighborCount > minPts * 5) { - fprintf(stderr, "\nWith eps of %f, %ld has %ld neighbors.", threshold, pFace->faceId, neighborCount); threshold *= 0.9; - freeChain(pNeighbors); - pNeighbors = RangeQuery(ppFaces, faceCount, pFace, threshold); - neighborCount = chainLength(pNeighbors); + freeChain(pSubNeighbors); + pSubNeighbors = RangeQuery(ppFaces, faceCount, pQ, threshold); + neighborCount = chainLength(pSubNeighbors); + fprintf(stderr, "With eps of %f, %ld has %ld neighbors.\n", threshold, pQ->faceId, neighborCount); } if (neighborCount >= minPts) {