Reducing threshold:

Signed-off-by: James Ketrenos <james_gitlab@ketrenos.com>
This commit is contained in:
James Ketrenos 2020-01-10 19:52:31 -08:00
parent f5c3c14257
commit 0d345980dc

View File

@ -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) {