Nodes/opencv-comfyui/OpenCV isContourConvex_1
ComfyUI Node

OpenCV isContourConvex_1

The boolean twin nobody needs to fear

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV isContourConvex_1
  • contour
  • bool

OpenCV isContourConvex_1 is the duplicate-overload twin of isContourConvex_0 - same cv2.isContourConvex call, same single contour input, same boolean output. isContourConvex appears twice in OpenCV's type stubs, the auto-generator made two numbered nodes, and there is no functional difference between them. Read the _0 page for the mechanics; this one is the short version.

What it does

Tests whether a contour (an N×2 NPARRAY of points) is geometrically convex, and returns True or False. Convexity is the precondition for a bunch of other geometry functions - intersectConvexConvex_0 needs convex inputs, convexityDefects_0 only makes sense on concave shapes - so this node is a gate or a diagnostic in front of those.

Inputs and outputs

  • contour - NPARRAY of contour points.
  • Output bool - BOOLEAN.

The honest friction

The same as _0: this pack has no findContours, so image→contour isn't something these nodes do. Contours must arrive from a scripting node, a segmentation boundary, or the pack's own convexHull_0 / approxPolyDP_0. If you don't already have point-array plumbing, this node won't be your entry point into geometry.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
cd opencv-comfyui
pip install -r requirements.txt

or ComfyUI Manager → "opencv-comfyui". No models; deps are opencv-contrib-python, numpy, torch.

Gotchas

Don't read the _1 suffix as an upgrade - there are no extra parameters, no second behavior, just the same boolean in a second skin. Keep batch_size == 1, and remember this tests geometry, not image content: a mask image in, a meaningless answer out.

Categoryimage/OpenCV

Inputs (1)

NameTypeDefaultDescription
contourNPARRAY

Outputs (1)

NameTypeDescription
boolBOOLEAN