File tree Expand file tree Collapse file tree
segmentation/include/pcl/segmentation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,9 +179,8 @@ namespace pcl
179179 for (std::size_t j = 0 ; j < seed_queue.size (); ++j)
180180 r.indices [j] = seed_queue[j];
181181
182- // These two lines should not be needed: (can anyone confirm?) -FF
182+ // After clustering, indices are out of order, so sort them
183183 std::sort (r.indices .begin (), r.indices .end ());
184- r.indices .erase (std::unique (r.indices .begin (), r.indices .end ()), r.indices .end ());
185184
186185 r.header = cloud.header ;
187186 clusters.push_back (r); // We could avoid a copy by working directly in the vector
@@ -299,9 +298,8 @@ namespace pcl
299298 for (std::size_t j = 0 ; j < seed_queue.size (); ++j)
300299 r.indices [j] = seed_queue[j];
301300
302- // These two lines should not be needed: (can anyone confirm?) -FF
301+ // After clustering, indices are out of order, so sort them
303302 std::sort (r.indices .begin (), r.indices .end ());
304- r.indices .erase (std::unique (r.indices .begin (), r.indices .end ()), r.indices .end ());
305303
306304 r.header = cloud.header ;
307305 clusters.push_back (r);
Original file line number Diff line number Diff line change @@ -106,9 +106,8 @@ pcl::extractEuclideanClusters (const PointCloud<PointT> &cloud,
106106 for (std::size_t j = 0 ; j < seed_queue.size (); ++j)
107107 r.indices [j] = seed_queue[j];
108108
109- // These two lines should not be needed: (can anyone confirm?) -FF
109+ // After clustering, indices are out of order, so sort them
110110 std::sort (r.indices .begin (), r.indices .end ());
111- r.indices .erase (std::unique (r.indices .begin (), r.indices .end ()), r.indices .end ());
112111
113112 r.header = cloud.header ;
114113 clusters.push_back (r); // We could avoid a copy by working directly in the vector
@@ -203,10 +202,8 @@ pcl::extractEuclideanClusters (const PointCloud<PointT> &cloud,
203202 // This is the only place where indices come into play
204203 r.indices [j] = seed_queue[j];
205204
206- // These two lines should not be needed: (can anyone confirm?) -FF
207- // r.indices.assign(seed_queue.begin(), seed_queue.end());
205+ // After clustering, indices are out of order, so sort them
208206 std::sort (r.indices .begin (), r.indices .end ());
209- r.indices .erase (std::unique (r.indices .begin (), r.indices .end ()), r.indices .end ());
210207
211208 r.header = cloud.header ;
212209 clusters.push_back (r); // We could avoid a copy by working directly in the vector
Original file line number Diff line number Diff line change @@ -129,9 +129,8 @@ pcl::extractLabeledEuclideanClusters(
129129 r.indices .resize (seed_queue.size ());
130130 for (std::size_t j = 0 ; j < seed_queue.size (); ++j)
131131 r.indices [j] = seed_queue[j];
132-
132+ // After clustering, indices are out of order, so sort them
133133 std::sort (r.indices .begin (), r.indices .end ());
134- r.indices .erase (std::unique (r.indices .begin (), r.indices .end ()), r.indices .end ());
135134
136135 r.header = cloud.header ;
137136 labeled_clusters[cloud[i].label ].push_back (
You can’t perform that action at this time.
0 commit comments