ComfyUI Node
cv2.reduce
Raw wrapper of cv2.reduce(src, dim, rtype, dtype?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.
cv2.reduce
- src
- nparray
◄dim0►
◄rtypeREDUCE_SUM►
◄dtypesame as input►
Categoryimage/CV/low-level/cv2 R
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY,IMAGE,MASK | input 2D matrix. 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. | |
| dim | INT | 0-2147483648–2147483647 | dimension index along which the matrix is reduced. 0 means that the matrix is reduced to a single row. 1 means that the matrix is reduced to a single column. |
| rtype | COMBO | REDUCE_SUM | reduction operation that could be one of #ReduceTypes |
| dtypeopt | COMBO | same as input | when negative, the output vector will have the same type as the input matrix, otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), src.channels()). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |