DBSCAN icon indicating copy to clipboard operation
DBSCAN copied to clipboard

unable to interpret output

Open omerbrandis opened this issue 4 years ago • 0 comments

hi

I guess that int returned by vector<vector > getCluster() represents the index in the points array provided to the constructor.

and yet, I've received out of bounds results using the following code std::cout << "debug - points.size = " << Points.size() << std::endl; DBSCAN ds(5, 0, Points); ds.run();

std::cout << "number of clusters found = " << ds.getCluster().size() << std::endl; int CurrentClusterId = 0; for (vector<vector>::const_iterator It = ds.getCluster().begin(); It != ds.getCluster().end(); It++) { CurrentClusterId++; for (vector::const_iterator InnerIt = It->begin() ;InnerIt != It->end(); InnerIt++) { std::cout << *InnerIt<< std::endl; // each item in the clusters variable is a index to the original list...and yet got out of range results... :-( OutputGrid[(int)Points.at(*InnerIt).x][(int)Points.at(*InnerIt).y] = CurrentClusterId; } }

returns debug - points.size = 5208 number of clusters found = 69 1086 1087 321 0 27744976 terminate called after throwing an instance of 'std::out_of_range'.....

please advise, Omer.

omerbrandis avatar Apr 13 '21 11:04 omerbrandis