Nodes/opencv-comfyui/OpenCV warpPolar_1
ComfyUI Node

OpenCV warpPolar_1

The second polar warp overload — same vortex, same flags, pick one

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV warpPolar_1
  • src
  • dst
  • nparray
dsize
center
maxRadius
flags

warpPolar_1 is the _1 overload of cv2.warpPolar, and in this pack it's a functional twin of warpPolar_0. Same inputs, same behavior, same little-planet output. The generator numbered the OpenCV overloads and both collapsed into the same wrapper, so there's no reason to agonize over which you grab - ComfyUI will happily let you use either.

The function is the fun one in the geometric-warp family. warpPolar remaps an image between polar and Cartesian coordinates around a center point, bounded by a maxRadius, into an output of dsize. That's the machinery behind "little planet" images (a flat scene swirling into a circular sphere view), unrolling an annular texture into a strip, and unwrapping a circular fisheye projection. You control the flavor with flags: WARP_POLAR_LINEAR (256) for even radial spacing, WARP_POLAR_LOG (512) to spread out the center logarithmically like a fisheye unwrap, and WARP_INVERSE_MAP (16) to go backwards from polar to Cartesian.

Inputs and outputs

  • src - NPARRAY image via Image2Nparray.
  • dsize - output size literal, e.g. (720, 360).
  • center - literal point, (256, 256) or (w // 2, h // 2) - the // works because the pack parses it as Python.
  • maxRadius - FLOAT; the radius that maps to the output's edge.
  • flags - interpolation plus mode. 257 = linear + linear-polar; 513 = linear + log-polar.

Skip optional dst. Output: one nparray.

Installing

Same as every node here:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui

or ComfyUI Manager, search "opencv-comfyui", install, restart. Dependencies: opencv-contrib-python, numpy, torch.

Quick gotchas

The flags are unforgiving and unlabeled - test 256 vs 512 on a copy before you commit to a look. center and dsize are literal strings, so invalid syntax (<unknown>, line 0) means you wrote them as bare numbers instead of tuples. And the forward output is a polar strip, not a picture - don't panic when it looks like abstract mush; that's what a polar map is supposed to look like until you use it or invert it.

Categoryimage/OpenCV

Inputs (6)

NameTypeDefaultDescription
srcNPARRAY
dsizeSTRING
centerSTRING
maxRadiusFLOAT
flagsINT
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY