ComfyUI Node
CV HOG Features
Histogram-of-Oriented-Gradients descriptor per frame (cv2.HOGDescriptor): each input frame is grayscaled, resized to win_size x win_size and reduced to one fixed-length gradient-orientation feature row - the classic hand-crafted descriptor for training a shape/digit classifier ('CV Train Classifier'). The defaults (win 20, cell 10, block 10, stride 5, 9 bins) give the 81-dim descriptor of OpenCV's digits.py tutorial. Geometry rules (raised as errors, they are configuration mistakes): win_size and block_size must be multiples of cell_size, and (win_size - block_size) must be a multiple of block_stride. An empty IMAGE batch yields an empty (0, D) array.
CV HOG Features
- image
- features
- dims
- count
◄win_size20►
◄cell_size10►
◄block_size10►
◄block_stride5►
◄nbins9►
Categoryimage/CV/ml
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | NPARRAY,IMAGE | Frames to describe: an IMAGE batch gives one feature row per frame; an NPARRAY (gray/BGR/BGRA) is a single frame. 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. | |
| win_size | INT | 208–512 | Square window size in px - every frame is resized to this before computing. Bigger keeps more detail but grows the descriptor. |
| cell_size | INT | 102–256 | Histogram cell size in px. win_size and block_size must be multiples of it. |
| block_size | INT | 102–256 | Normalization block size in px (a multiple of cell_size, at most win_size). |
| block_stride | INT | 51–256 | Block step in px; (win_size - block_size) must be a multiple of it. |
| nbins | INT | 92–32 | Orientation bins per histogram (9 is the standard). |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| features | NPARRAY | (N, D) float32, one HOG row per frame - feeds 'CV Train Classifier' or 'CV Stack Feature Classes'. |
| dims | INT | Descriptor length D (81 with the defaults). |
| count | INT | Frames described. |