-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBSCAN clustering algorithm #1038
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Added some small comments.
Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @griegler)
src/Open3D/Geometry/PointCloudCluster.cpp, line 52 at r1 (raw file):
std::vector<int> nbs; std::vector<double> dists2; kdtree.SearchRadius(points_[idx], eps2, nbs, dists2);
from https://github.com/intel-isl/Open3D/blob/e151b0bc0e95e7c3605fd7627335b648b2f555a3/src/Open3D/Geometry/KDTreeFlann.cpp#L152-L153, looks like the esp
is squared internally by SearchRadius
, so we shall probably use esp
instead of esp2
?
src/Open3D/Geometry/PointCloudCluster.cpp, line 60 at r1 (raw file):
} std::unordered_set<int> nbs_next(nbs.begin(), nbs.end());
maybe it's cleaner to use std::deque<int>
, orstd::stack<int>
(if we conver to DFS) ? seems like we're not using the "set" property here.
src/Open3D/Geometry/PointCloudCluster.cpp, line 78 at r1 (raw file):
labels[nb] = cluster_label; kdtree.SearchRadius(points_[nb], eps2, nbs, dists2);
same, esp2
-> esp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 6 files reviewed, 3 unresolved discussions (waiting on @yxlao)
src/Open3D/Geometry/PointCloudCluster.cpp, line 52 at r1 (raw file):
Previously, yxlao (Yixing Lao) wrote…
from https://github.com/intel-isl/Open3D/blob/e151b0bc0e95e7c3605fd7627335b648b2f555a3/src/Open3D/Geometry/KDTreeFlann.cpp#L152-L153, looks like the
esp
is squared internally bySearchRadius
, so we shall probably useesp
instead ofesp2
?
thanks, changed it to eps
.
src/Open3D/Geometry/PointCloudCluster.cpp, line 60 at r1 (raw file):
Previously, yxlao (Yixing Lao) wrote…
maybe it's cleaner to use
std::deque<int>
, orstd::stack<int>
(if we conver to DFS) ? seems like we're not using the "set" property here.
the set property is used in the insert step. In deque, or stack it would possibly insert some indices multiple times.
src/Open3D/Geometry/PointCloudCluster.cpp, line 78 at r1 (raw file):
Previously, yxlao (Yixing Lao) wrote…
same,
esp2
->esp
?
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 6 files reviewed, 3 unresolved discussions (waiting on @griegler and @yxlao)
src/Open3D/Geometry/PointCloudCluster.cpp, line 60 at r1 (raw file):
From here, are we already checking that nbs_visited.count(qnb) == 0
before inserting?
if (nbs_visited.count(qnb) == 0) { nbs_next.insert(qnb); }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @yxlao)
src/Open3D/Geometry/PointCloudCluster.cpp, line 60 at r1 (raw file):
Previously, yxlao (Yixing Lao) wrote…
From here, are we already checking that
nbs_visited.count(qnb) == 0
before inserting?if (nbs_visited.count(qnb) == 0) { nbs_next.insert(qnb); }
but nbs_visited
and nbs_next
are different. A point can be inserted multiple times into nbs_next
before it is actually visited (and inserted into nbs_visited
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @griegler and @yxlao)
src/Open3D/Geometry/PointCloudCluster.cpp, line 60 at r1 (raw file):
Previously, griegler (Gernot) wrote…
but
nbs_visited
andnbs_next
are different. A point can be inserted multiple times intonbs_next
before it is actually visited (and inserted intonbs_visited
).
i see, this could be more efficient, thanks for the explanation
Implementation of the DBSCAN clustering algorithm for
PointCloud
. Implementation is not threaded for now, but could be a simple addition.This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)