59 unsigned label = (*labels)[
start_idx].label;
62 Neighbor
directions [8] = {Neighbor(-1, 0, -1),
63 Neighbor(-1, -1, -labels->width - 1),
64 Neighbor( 0, -1, -labels->width ),
65 Neighbor( 1, -1, -labels->width + 1),
67 Neighbor( 1, 1, labels->width + 1),
68 Neighbor( 0, 1, labels->width ),
69 Neighbor(-1, 1, labels->width - 1)};
81 if (x >= 0 && x <
int(labels->width) && y >= 0 && y <
int(labels->height) && (*labels)[index].label != label)
103 if (x >= 0 && x <
int(labels->width) && y >= 0 && y <
int(labels->height) && (*labels)[index].label == label)
108 direction = (
nIdx + 4) & 7;
122 unsigned invalid_label = std::numeric_limits<unsigned>::max ();
124 invalid_pt.label = std::numeric_limits<unsigned>::max ();
126 labels.width = input_->width;
127 labels.height = input_->height;
131 if (std::isfinite ((*input_)[0].x))
134 run_ids.push_back (labels[0].label );
140 if (!std::isfinite ((*input_)[
colIdx].x))
207 std::vector<unsigned> map (
clust_id);
219 for (std::size_t idx = 0; idx < input_->size (); idx++)
223 labels[idx].label = map[labels[idx].label];