Nodes/comfyui_cv/CV Reduce Points By Label
ComfyUI Node

CV Reduce Points By Label

Collapses a labeled point set (from 'CV K-Means Points') to one representative point per cluster: the centroid, or the member farthest from / closest to an origin (e.g. the tip of each clock hand, the innermost match of each group). Rows follow the label order (0, 1, ...), so outputs of several reductions over the same labels stay aligned. The distances output (representative-to-origin) doubles as a sort key for 'CV Pick Value'.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Reduce Points By Label
  • points
  • labels
  • points
  • distances
  • count
reductioncentroid
origin_x0.00
origin_y0.00
Categoryimage/CV/points

Inputs (5)

NameTypeDefaultDescription
pointsNPARRAYNx1x2 labeled points (same order as 'labels').
labelsNPARRAY(N,) integer label per point.
reductionCOMBOcentroidRepresentative per cluster: its centroid (mean), or the member farthest from / closest to the origin.
origin_xFLOAT0.00-1000000–1000000X pixel coordinate of the reference origin (e.g. the dial center, anchor, or ray start).
origin_yFLOAT0.00-1000000–1000000Y pixel coordinate of the reference origin (e.g. the dial center, anchor, or ray start).

Outputs (3)

NameTypeDescription
pointsNPARRAYKx1x2 float32, one point per label.
distancesNPARRAY(K,) float32 distance of each representative to the origin.
countINTK, the number of labels.