Nodes/comfyui_cv/cv2.optflow.calcOpticalFlowSparseToDense
ComfyUI Node

cv2.optflow.calcOpticalFlowSparseToDense

Raw wrapper of cv2.optflow.calcOpticalFlowSparseToDense(from_, to, grid_step?, k?, sigma?, use_post_proc?, fgs_lambda?, fgs_sigma?). Parameters marked '?' are optional; blank means OpenCV default. From the opencv-contrib 'optflow' module. See the OpenCV documentation for details.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
cv2.optflow.calcOpticalFlowSparseToDense
  • from_
  • to
  • nparray
grid_step8
k128
sigma0.0500
use_post_proctrue
fgs_lambda500.0000
fgs_sigma1.5000
Categoryimage/CV/low-level/optflow

Inputs (8)

NameTypeDefaultDescription
from_NPARRAY,IMAGE,MASK - - - 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.
toNPARRAY,IMAGE,MASKsecond 8-bit 3-channel or 1-channel image of the same size as from 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.
grid_stepoptINT8-2147483648–2147483647stride used in sparse match computation. Lower values usually result in higher quality but slow down the algorithm. Preset to the OpenCV default (8).
koptINT128-2147483648–2147483647number of nearest-neighbor matches considered, when fitting a locally affine model. Lower values can make the algorithm noticeably faster at the cost of some quality degradation. Preset to the OpenCV default (128).
sigmaoptFLOAT0.0500-1e+38–1e+38parameter defining how fast the weights decrease in the locally-weighted affine fitting. Higher values can help preserve fine details, lower values can help to get rid of the noise in the output flow. Preset to the OpenCV default (0.05).
use_post_procoptBOOLEANtruedefines whether the ximgproc::fastGlobalSmootherFilter() is used for post-processing after interpolation Preset to the OpenCV default (True).
fgs_lambdaoptFLOAT500.0000-1e+38–1e+38see the respective parameter of the ximgproc::fastGlobalSmootherFilter() Preset to the OpenCV default (500.0).
fgs_sigmaoptFLOAT1.5000-1e+38–1e+38see the respective parameter of the ximgproc::fastGlobalSmootherFilter() Preset to the OpenCV default (1.5).

Outputs (1)

NameTypeDescription
nparrayNPARRAY