Nodes/comfyui_cv/cv2.approxPolyN
ComfyUI Node

cv2.approxPolyN

Raw wrapper of cv2.approxPolyN(curve, nsides, epsilon_percentage?, ensure_convex?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
cv2.approxPolyN
  • curve
  • nparray
nsides0
epsilon_percentage-1.0000
ensure_convextrue
Categoryimage/CV/low-level/cv2 A

Inputs (4)

NameTypeDefaultDescription
curveNPARRAYInput vector of a 2D points stored in std::vector or Mat, points must be float or integer. A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
nsidesINT0-2147483648–2147483647The parameter defines the number of sides of the result polygon.
epsilon_percentageoptFLOAT-1.0000-1e+38–1e+38defines the percentage of the maximum of additional area. If it equals -1, it is not used. Otherwise algorithm stops if additional area is greater than contourArea(_curve) * percentage. If additional area exceeds the limit, algorithm returns as many vertices as there were at the moment the limit was exceeded. Preset to the OpenCV default (-1.0).
ensure_convexoptBOOLEANtrueIf it is true, algorithm creates a convex hull of input contour. Otherwise input vector should be convex. Preset to the OpenCV default (True).

Outputs (1)

NameTypeDescription
nparrayNPARRAY