Nodes/opencv-comfyui/OpenCV ellipse_3
ComfyUI Node

OpenCV ellipse_3

The RotatedRect ellipse, overload two — same box, same BGR

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV ellipse_3
  • img
  • nparray
box
color
thickness
lineType

ellipse_3 is ellipse_2's overload twin - OpenCV's type stubs declare the RotatedRect form of cv2.ellipse for both MatLike and UMat, and this pack emitted a node per declaration. Identical behavior, no reason to prefer one over the other. Grab whichever your workflow already has.

What the pair does: draws the ellipse that a RotatedRect describes. That's the object-detection visualization case - fitEllipse and minAreaRect both hand you a ((center), (size), angle) package, and this node turns it into visible geometry.

Inputs

  • img - your NPARRAY.
  • box - STRING literal in the form ((cx, cy), (w, h), angle) - center, full width/height of the bounding rectangle, rotation in degrees. Triple-nested, and the pack parses it with ast.literal_eval, so keep it valid Python.
  • color - STRING literal in BGR ((0, 0, 255) = red).
  • thickness - negative to fill.
  • lineType - 8 or 16 (anti-aliased).

One nparray output.

Install

opencv-comfyui (geroldmeisinger). ComfyUI Manager → search OpenCV, or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-python-contrib

Restart. requirements.txt: opencv-contrib-python, numpy, torch; no model files.

What bites

Same two recurring traps as every drawing node in this pack: malformed literals (missing parens → invalid syntax (<unknown>, line 0)) and BGR color order (your "red" is (0, 0, 255), because Image2Nparray already flipped the image to BGR). Plus the standing rules - Image2Nparray in, Nparrays2Image out, batch_size==1 only.

Between ellipse_2 and ellipse_3 there is genuinely nothing to choose. Between the RotatedRect form and the full-parameter ellipse_0/ellipse_1 form, the choice is about where your geometry comes from: fitted detections → this pair; hand-specified arcs and angles → the other. For rotated-box visualization, you're in the right place.

Categoryimage/OpenCV

Inputs (5)

NameTypeDefaultDescription
imgNPARRAY
boxSTRING
colorSTRING
thicknessINT
lineTypeINT

Outputs (1)

NameTypeDescription
nparrayNPARRAY