Nodes/comfyui_cv/CV Contour To Points
ComfyUI Node

CV Contour To Points

Bridges the CV_CONTOURS type to a plain NPARRAY point array so ONE contour can feed the raw cv2 geometry wrappers (cv2.convexHull, cv2.convexityDefects, cv2.intersectConvexConvex, cv2.pointPolygonTest, cv2.fitEllipse, cv2.contourArea...) or the point-set nodes. The inverse bridge is 'CV Points To Contour'. Failure-tolerant: an index past the end yields found=false and an empty (0,1,2) array instead of an error.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Contour To Points
  • contours
  • points
  • count
  • found
index0
dtypeint32 (native contour)
Categoryimage/CV/contours

Inputs (3)

NameTypeDefaultDescription
contoursCV_CONTOURSFrom 'CV Find Contours'.
indexINT00–100000Which contour of the set to convert (Find Contours sorts by area, largest first - 0 = biggest).
dtypeCOMBOint32 (native contour)Element type. Keep int32 for cv2.convexityDefects (it requires the ORIGINAL integer contour); float32 for subpixel geometry (cv2.intersectConvexConvex).

Outputs (3)

NameTypeDescription
pointsNPARRAY(N,1,2) point array - the layout every cv2 geometry function and draw node expects.
countINT
foundBOOLEAN