Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > opencv-comfyui > OpenCV accumulateWeighted_0

ComfyUI Node: OpenCV accumulateWeighted_0

Class Name

accumulateWeighted_0

Category
image/OpenCV
Author
geroldmeisinger (Account age: 1432days)
Extension
opencv-comfyui
Latest Updated
2026-07-22
Github Stars
0.04K

How to Install opencv-comfyui

Install this extension via the ComfyUI Manager by searching for opencv-comfyui
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter opencv-comfyui in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

OpenCV accumulateWeighted_0 Description

Performs weighted image accumulation for dynamic averaging and temporal smoothing using OpenCV.

OpenCV accumulateWeighted_0:

The accumulateWeighted_0 node is designed to perform a weighted accumulation of images, which is a technique commonly used in image processing to create a running average of a sequence of images. This node leverages the OpenCV accumulateWeighted function to blend a source image into a destination image using a specified weight, or alpha value. This process is particularly useful for applications such as background subtraction, where you want to maintain a dynamic average of a scene over time. By adjusting the weight, you can control how quickly the accumulated image adapts to changes in the scene, making this node a powerful tool for tasks that require temporal smoothing or noise reduction.

OpenCV accumulateWeighted_0 Input Parameters:

src

The src parameter represents the source image, which is the new image data that you want to incorporate into the accumulated result. This parameter is crucial as it provides the fresh input that will be blended with the existing accumulated image. The source image should be provided as a NumPy array (NPARRAY), and it typically needs to be of the same size and type as the destination image to ensure proper blending.

dst

The dst parameter is the destination image, which holds the accumulated result. This image is updated with the weighted sum of itself and the source image. Like the source image, the destination image should also be a NumPy array (NPARRAY) and should match the dimensions and type of the source image. The dst image is modified in place, meaning it will contain the updated accumulated result after the function executes.

alpha

The alpha parameter is a floating-point value that determines the weight of the source image in the accumulation process. It controls the influence of the new image data on the accumulated result. A higher alpha value gives more weight to the source image, allowing the accumulated image to adapt more quickly to changes, while a lower alpha value results in slower adaptation. The typical range for alpha is between 0 and 1, where 0 means no influence from the source image and 1 means the accumulated image is entirely replaced by the source image.

mask

The mask parameter is optional and allows you to specify a region of interest within the images. It is a binary mask, provided as a NumPy array (NPARRAY), where non-zero values indicate the pixels that should be included in the accumulation process. This parameter is useful when you want to focus the accumulation on specific areas of the image, ignoring others. If not provided, the entire image is used for accumulation.

OpenCV accumulateWeighted_0 Output Parameters:

nparray

The nparray output parameter is the resulting accumulated image after the weighted blending process. It is returned as a NumPy array (NPARRAY) and contains the updated image data that reflects the influence of the source image as determined by the alpha value. This output is essential for applications that require a continuously updated image, such as dynamic background modeling or temporal filtering.

OpenCV accumulateWeighted_0 Usage Tips:

  • To achieve a smooth transition in dynamic scenes, experiment with different alpha values. A smaller alpha will result in a slower adaptation, which is useful for stable environments, while a larger alpha will allow for quicker adaptation to changes.
  • Use the mask parameter to focus on specific areas of interest within the image, which can be particularly useful in scenarios where only certain regions are subject to change or need to be monitored.

OpenCV accumulateWeighted_0 Common Errors and Solutions:

Mismatched Image Sizes

  • Explanation: The source and destination images must be of the same size and type for the accumulation to work correctly.
  • Solution: Ensure that both src and dst images are preprocessed to have the same dimensions and data type before passing them to the node.

Invalid Alpha Value

  • Explanation: The alpha value must be a float between 0 and 1 to properly weight the source image.
  • Solution: Verify that the alpha parameter is set within the valid range and adjust it accordingly to achieve the desired blending effect.

Mask Dimension Mismatch

  • Explanation: If a mask is provided, it must match the dimensions of the source and destination images.
  • Solution: Check that the mask parameter is correctly sized to match the images, and adjust it if necessary to ensure proper application of the mask.

OpenCV accumulateWeighted_0 Related Nodes

Go back to the extension to check out more related nodes.
opencv-comfyui
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

OpenCV accumulateWeighted_0