Nodes/opencv-comfyui/OpenCV convexHull_1
ComfyUI Node

OpenCV convexHull_1

ConvexHull_1 — the second copy of the rubber-band outline node

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV convexHull_1
  • points
  • hull
  • nparray
clockwise
returnPoints

convexHull_1 is convexHull_0 wearing a different suffix. OpenCV's Python type definitions carry two overloads of cv2.convexHull - one for MatLike arrays, one for UMat - and this auto-generated pack shipped a node for each. The generated implementations are identical, because both collapse onto the same NPARRAY socket. So the full tutorial lives over at convexHull_0, and this page is the "you landed on the twin" signpost.

For the record, what both do: take points (an NPARRAY of points, typically a contour from findContours_0), compute the smallest convex polygon that contains them all, and return it as an NPARRAY of hull points - or, if you set returnPoints to False, as indices into the original array. That index form is what convexityDefects_0 needs, so that's the one real interaction to remember. clockwise (True = clockwise winding) is the other boolean and mostly cosmetic unless downstream code cares about ordering.

This is the shape-analysis layer under ComfyUI's detection loop: once a detector finds a region, the hull gives you a clean boundary to measure, compare, or feed onward. Paired with contourArea_0, the hull-vs-contour area ratio is a neat compactness score that tells you whether a detected blob is solid or scalloped.

Install and the pack's usual rules

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

Or ComfyUI Manager → opencv-comfyui → restart.

Then the reminders that apply to every node in this pack: it eats numpy NPARRAYs, so Comfy images route through Image2Nparray (batch 1 only), and the output here is a point array, not a picture - don't expect Nparrays2Image to display it. If you want to visualize the hull, draw it onto a copy first.

_0 or _1? There's no difference to detect. If your workflow has convexHull_1 wired in, keep it; if you're adding fresh, grab whichever the search box shows you first. Same math, same result.

Categoryimage/OpenCV

Inputs (4)

NameTypeDefaultDescription
pointsNPARRAY
clockwiseBOOLEAN
returnPointsBOOLEAN
hulloptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY