ComfyUI Node
CV Radial Lens Map
Polynomial radial (lens) distortion, like ImageMagick's barrel distort: scales each coordinate's distance to the center by a*r^3 + b*r^2 + c*r + d (r normalized so r = 1 at the nearest edge). Positive b bulges the center outward (barrel/fisheye look), negative b pinches it (pincushion); mixing signs of a and b gives mustache distortion. The inverse form undoes the polynomial with the SAME coefficients (it solves r' * P(r') = r per pixel with a few Newton steps, the technique cv2.undistortPoints uses) - chain both to round-trip a distortion to sub-pixel accuracy. Where the polynomial is not monotonic (extreme coefficients fold the image onto itself) the inverse clamps to the last invertible radius instead of blowing up.
CV Radial Lens Map
- map_x
- map_y
- map_x
- map_y
◄a0.00►
◄b0.15►
◄c0.00►
◄formulapolynomial: r * (a r^3 + b r^2 + c r + d)►
◄d0.00►
◄center_x0.50►
◄center_y0.50►
Categoryimage/CV/remap
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| map_x | NPARRAY | Incoming source-x coordinate map to distort. Start the chain with 'CV Identity Map'; further remap nodes compose onto it. | |
| map_y | NPARRAY | Incoming source-y coordinate map (must share map_x's shape - both come from the same chain). | |
| a | FLOAT | 0.00-8–8 | r^3 coefficient. |
| b | FLOAT | 0.15-8–8 | r^2 coefficient: + barrel, - pincushion. |
| c | FLOAT | 0.00-8–8 | r coefficient. |
| formula | COMBO | polynomial: r * (a r^3 + b r^2 + c r + d) | polynomial applies the distortion; inverse undoes it with the same coefficients (chain both to round-trip). |
| dopt | FLOAT | 0.00-8–8 | Constant term; 0 = auto (1 - a - b - c), which keeps the r = 1 circle fixed. |
| center_xopt | FLOAT | 0.500–1 | Distortion center as a fraction of the width. |
| center_yopt | FLOAT | 0.500–1 | Distortion center as a fraction of the height. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| map_x | NPARRAY | — |
| map_y | NPARRAY | — |