OpenCV boxPoints_1
Same rotated-rect corners, duplicate overload
- points
- nparray
OpenCV boxPoints_1 is the twin of boxPoints_0 - same function, second overload, no behavioral difference. opencv-comfyui auto-generated a node for every overload of every top-level cv2 function it found in OpenCV's type stubs, and cv2.boxPoints has two. Pick one and forget the other; the naming tells you nothing about which to use.
The function itself is genuinely handy for a specific job. OpenCV's RotatedRect - center, width/height, angle - is the compact way to describe an angled box, but nothing downstream can use it directly. boxPoints expands it into the four actual corner coordinates as an (N, 2) float array. That's what you need to draw the box, mask around it, or feed the corners into boundingRect to get the tight axis-aligned rectangle of a tilted object - the standard bridge between "oriented detection" and "crop node that only speaks upright boxes."
Inputs and output
- box - a STRING literal, typed as a Python tuple:
((250, 250), (200, 100), 30)=(center_x, center_y),(width, height),angle_degrees. The pack parses composite types from strings, so valid-Python syntax is mandatory; a malformed literal throwsinvalid syntax (<unknown>, line 0). - points (optional) -
NPARRAYout-parameter; leave unwired.
Output: one nparray, shape (4, 2) float32 - the four corners around the perimeter.
Install and the caveats
ComfyUI Manager → opencv-comfyui, or clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes, restart. Needs opencv-contrib-python.
Pack-wide rules still hold: batch size 1, NPARRAY in/out means BGR/uint8 conventions, you handle the conversions. The one specific gotcha is the box string: angle in degrees, order strictly center → size → angle. There's no minAreaRect node in this pack to feed it automatically, so realistically you'll supply the tuple yourself. If that sounds like more trouble than it's worth for a box you could compute by hand - sometimes it is. This is a geometry utility for the CV-curious, and _0 vs _1 is the least of your concerns.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| box | STRING | — | |
| pointsopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |