Nodes/comfyui_cv/CV Flow To Color
ComfyUI Node

CV Flow To Color

Debug helper: renders a per-pixel ANGLE field as the standard color wheel (angle = hue, magnitude = brightness) - the proper way to look at gradient directions, optical flow or any other vector field; a plain grayscale render of angles lies at the 0/360 wrap-around. Feed it cv2_cartToPolar's two outputs. Without a magnitude, every pixel renders at full brightness.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Flow To Color
  • angle
  • magnitude
  • nparray
angle_unitradians (0-2*pi, cartToPolar default)
max_magnitude0.00
Categoryimage/CV/features

Inputs (4)

NameTypeDefaultDescription
angleNPARRAYHxW per-pixel angles (cv2_cartToPolar output).
angle_unitCOMBOradians (0-2*pi, cartToPolar default)Set to degrees when cartToPolar ran with angleInDegrees=true.
max_magnitudeFLOAT0.000–1000000000Magnitude mapped to full brightness; larger values clip. 0 = auto (the field's own maximum) - set it explicitly to compare renders across images on the same scale.
magnitudeoptNPARRAYHxW per-pixel magnitudes; scales brightness so weak vectors fade out. Must match the angle shape.

Outputs (1)

NameTypeDescription
nparrayNPARRAYBGR uint8 rendering: HUE is the angle (0 deg / east at hue 0, then round the wheel) and BRIGHTNESS is the magnitude. Direction is carried by hue alone, which is the axis a colour-blind reader loses - read this as a picture of where the motion changes, and take the angle itself off the numbers ('Inspect CV Data') rather than off the colour.