OpenCV linearPolar_1
OpenCV linearPolar_1 — the polar unwrap node, minus the mystery
- src
- dst
- nparray
OpenCV linearPolar_1 is the same node as OpenCV linearPolar_0. Every _0/_1 pair in opencv-comfyui is one function twice - OpenCV declares each function for plain matrices and for OpenCL-backed UMat images, and the generator numbered the two overloads instead of merging them. Same inputs, same output, same results. So read this for what the transform does, and treat linearPolar_0 as your copy of the manual.
What it does: remaps an image into polar coordinates around a center point, turning circles into straight lines. Distance from the center becomes the horizontal axis, angle becomes the vertical axis. Linear in the radius, hence the name.
When you'd actually use it
- Unrolling circular content - cylindrical panoramas, dials, wheel spokes, anything where "around a circle" is the geometry.
- Texture work - flattening a round pattern so you can edit it as a strip, then warp it back (there's no inverse-node in the pack, but
warpPolarexists as another pair if you want to round-trip). - Just poking at generated images - it's deterministic, instant, and a great way to see structure a straight view hides.
The inputs
- src -
NPARRAYin, viaImage2Nparray. Back out viaNparrays2Image. - center - string literal, e.g.
[512, 512]or(width/2, height/2). The pack parses these withast.literal_eval, so a typo meansinvalid syntax (<unknown>, line 0). - maxRadius - reach of the transform from the center. Set to about the max dimension of the image to grab the whole frame.
- flags - interpolation + border bits.
1isINTER_LINEAR; add8(WARP_FILL_OUTLIERS) to fill the empty corner regions instead of leaving them black.
Optional dst is a call-by-reference out-parameter in the OpenCV tradition. The README's advice applies: avoid feeding it. The result lands on the nparray output.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-contrib-python
Restart, or install via ComfyUI Manager (search "opencv"). The requirements are just opencv-contrib-python, numpy, torch - nothing to download beyond that.
Gotchas
- Non-square output - don't assume the result matches your source dimensions; the unwrap width follows
maxRadiusand angle range. - Black or stretched corners - raise
maxRadiusand/or set flag bit8. - Batch error -
Only images with batch_size==1 are supported!→ImageFromBatch, length=1. - Color-channel surprise - nparrays are BGR. If colors look swapped on the way out, that's expected until
Nparrays2Imageflips them back.
Fair warning: this is niche. If your workflow never involves circular geometry, you can skip it without guilt - the pack is huge precisely because it wraps every top-level cv2 function, not because you need them all. When you do need a polar unwrap, though, it's a one-node answer.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| center | STRING | — | |
| maxRadius | FLOAT | — | |
| flags | INT | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |