OpenCV cartToPolar_1
CartToPolar_1 — the twin of the vector-to-angle node (there's no difference)
- x
- y
- magnitude
- angle
- nparray_0
- nparray_1
cartToPolar_1 is cartToPolar_0 with a different name on the can. Same inputs, same outputs, same math - the pack that ships these nodes generates one node per overload in OpenCV's type definitions, and cartToPolar is declared for both MatLike and UMat, which come out as functionally identical duplicates. Nothing is gained by choosing _1 over _0. If you already read the _0 page, you know everything there is to know here.
For the quick version: this node converts Cartesian component images into polar form. Feed it x and y (NPARRAY, same shape) - typically Sobel/Scharr gradients or optical-flow displacement fields - and it returns nparray_0 (magnitude, i.e. sqrt(x² + y²)) and nparray_1 (angle, from atan2, in radians unless you set angleInDegrees (BOOLEAN) to True). Magnitude maps tell you how strong an edge or how fast a motion is at each pixel; angle maps tell you its direction. The optional magnitude and angle inputs are out-parameters the generator exposed - ignore them.
Where people get caught: the outputs are float data maps, not viewable images. A magnitude map is usually a single-channel float array, so don't expect to drop it into Nparrays2Image and see a normal picture - you'll likely need to normalize or re-quantize it first (the README's 'NoneType' object has no attribute 'shape' error is the classic symptom of treating a non-image nparray as an image). And remember the pack's global rules: NPARRAY in/out, BGR 0..255 uint8 on the OpenCV side, batch_size == 1 only, bridge from IMAGE with Image2Nparray.
Install is identical to every node in this pack. ComfyUI Manager → search "OpenCV", or:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-python-contrib
Restart, and you're done - no model files to fetch. Honestly, this whole family of twin nodes is the pack's way of telling you it auto-generated 635 cv2 functions and didn't hand-clean any of them. The author's sign-off applies: ugly, complex, "expect dragons." Pick _0 or _1; just don't let the existence of both make you think you're missing a feature.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| x | NPARRAY | — | |
| y | NPARRAY | — | |
| angleInDegrees | BOOLEAN | — | |
| magnitudeopt | NPARRAY | — | |
| angleopt | NPARRAY | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| nparray_0 | NPARRAY | — |
| nparray_1 | NPARRAY | — |