Nodes/comfyui_cv/cv2.CamShift
ComfyUI Node

cv2.CamShift

Raw wrapper of cv2.CamShift(probImage, window, criteria). 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.CamShift
  • probImage
  • rotatedRect
  • rect
window_x0
window_y0
window_w0
window_h0
criteria_typemax count or epsilon (whichever first)
criteria_max_count30
criteria_epsilon0.00
Categoryimage/CV/low-level/cv2 C

Inputs (8)

NameTypeDefaultDescription
probImageNPARRAY,IMAGE,MASKBack projection of the object histogram. See calcBackProject. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
window_xINT0-2147483648–2147483647Rectangle top-left corner X in pixels.
window_yINT0-2147483648–2147483647Rectangle top-left corner Y in pixels.
window_wINT00–2147483647Rectangle width in pixels (>= 0).
window_hINT00–2147483647Rectangle height in pixels (>= 0).
criteria_typeCOMBOmax count or epsilon (whichever first)When to stop iterating: after max_count iterations, when the change drops below epsilon, or whichever comes first.
criteria_max_countINT301–2147483647Maximum iterations (ignored when 'epsilon only').
criteria_epsilonFLOAT0.000–1e+38Target accuracy / smallest change worth continuing for (ignored when 'max count only').

Outputs (2)

NameTypeDescription
rotatedRectCV_ROTATED_RECT- - - Rotated rectangle ((center_x, center_y), (width, height), angle in degrees) - wire it into cv2.ellipse's box, cv2.boxPoints or cv2.rotatedRectangleIntersection.
rectBOUNDING_BOX- - - A cv2 Rect as core BOUNDING_BOX data ({x, y, width, height}, nested one group per frame) - feed 'Crop By Bounding Boxes', 'Draw BBoxes', or 'CV Split Tuple' for x/y/w/h.