Nodes/comfyui_cv/CV Points To Polar
ComfyUI Node

CV Points To Polar

Polar coordinates of each point relative to an origin: distance, angle in degrees [0, 360) and the unit direction vector. The direction points are ideal k-means features when grouping points by bearing (points along one ray collapse to a single direction regardless of how far out they sit) - cluster them with the 'CV K-Means Points' subgraph blueprint while keeping the original points for drawing.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Points To Polar
  • points
  • radius
  • angle
  • directions
  • count
origin_x0.00
origin_y0.00
angle_conventionclockwise from 12 o'clock (clock)
Categoryimage/CV/points

Inputs (4)

NameTypeDefaultDescription
pointsNPARRAYNx1x2 point array to convert (or None -> 0 points).
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).
angle_conventionCOMBOclockwise from 12 o'clock (clock)Clock convention: 12h = 0, 3h = 90, 6h = 180. Math convention: +x = 0, growing counter-clockwise (y up).

Outputs (4)

NameTypeDescription
radiusNPARRAY(N,) float32 distances.
angleNPARRAY(N,) float32 degrees [0, 360).
directionsNPARRAYNx1x2 float32 unit vectors (0,0 for points on the origin) - k-means features for grouping by bearing.
countINT