ComfyUI Node
CV Array Statistic
Reduces a whole array to ONE value per channel (median, mean, min, max or std), returning a 1-D NPARRAY you can broadcast straight into cv2 arithmetic (subtract, compare, add...) - the same shape 'CV Scalar' emits. The MEDIAN is the robust estimate of a field's DOMINANT value: e.g. the background / camera motion of an optical-flow field, which the median recovers even when a moving object contaminates a large minority of pixels (the mean gets dragged toward it). Subtract it from the field and threshold the residual to segment whatever moves differently. NaN/Inf are ignored.
CV Array Statistic
- nparray
- value
- text
◄statisticmedian (robust dominant value)►
Categoryimage/CV/low-level
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| nparray | NPARRAY | 2-D [H,W] or 3-D [H,W,C] array to reduce (e.g. an optical-flow field HxWx2). | |
| statistic | COMBO | median (robust dominant value) | Reduction applied over every pixel, per channel. Median = the dominant value (robust to outliers); mean = the average (sensitive to them); std = the spread. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| value | NPARRAY | 1-D float64, one element per input channel - broadcastable into cv2.subtract / compare / add like 'CV Scalar'. |
| text | STRING | The value(s) as a readable '(a, b, ...)' string - wire into core 'Preview as Text' (PreviewAny) to display. |