Visit ComfyUI Online for ready-to-use ComfyUI environment
Detect and process motion in images or videos, identifying regions of interest for real-time tracking and dynamic adjustments.
The MotionController
is a specialized node designed to detect and process motion within a given image or video frame. Its primary purpose is to analyze changes in a sequence of images, identifying regions of interest (ROI) where motion is detected. This node is particularly beneficial for applications that require real-time motion tracking or dynamic adjustments based on movement, such as interactive art installations or automated video editing. By leveraging advanced image processing techniques, the MotionController
can efficiently manage and update values associated with detected motion, ensuring that any subsequent actions or adjustments are optimized for the detected changes. This node is essential for artists and developers looking to incorporate motion-based interactivity into their projects, providing a robust framework for detecting and responding to motion in a seamless and efficient manner.
The image
parameter represents the input image or video frame that the node will analyze for motion. It is crucial for the node's operation as it serves as the primary data source for motion detection. The image should be provided in a format that the node can process, typically as a tensor or array. There are no specific minimum or maximum values, but the quality and resolution of the image can impact the accuracy of motion detection.
The roi_chain
parameter is a sequence of regions of interest (ROIs) that the node will evaluate for motion. This parameter allows you to specify which areas of the image should be monitored, enabling focused motion detection. The effectiveness of the node can be enhanced by carefully selecting ROIs that are relevant to the desired application. There are no specific constraints on the number of ROIs, but more ROIs may increase processing time.
The threshold
parameter determines the sensitivity of motion detection. It sets the minimum level of change required for motion to be recognized within an ROI. A lower threshold makes the node more sensitive to minor movements, while a higher threshold requires more significant changes to trigger motion detection. The choice of threshold can significantly affect the node's performance, with typical values ranging from 0 to 255.
The blur_size
parameter specifies the size of the Gaussian blur applied to the image before motion detection. Blurring helps reduce noise and improve the accuracy of motion detection by smoothing out minor variations. The blur size should be an odd integer, with larger values resulting in more smoothing. The choice of blur size can impact the node's ability to detect fine details versus larger movements.
The minimum_value
parameter sets the lower bound for any value updates resulting from detected motion. It ensures that the node's output values do not fall below a specified minimum, providing a constraint that can be useful for maintaining stability in dynamic systems. The specific minimum value will depend on the application's requirements.
The maximum_value
parameter defines the upper limit for value updates based on motion detection. It prevents the node's output values from exceeding a specified maximum, which can be important for maintaining control over the system's behavior. The maximum value should be chosen based on the desired range of output values.
The starting_value
parameter initializes the current value used in motion processing. It serves as the baseline from which any changes due to detected motion are calculated. The starting value can influence the initial state of the system and should be set according to the application's needs.
The rounding_mode
parameter determines how the node converts floating-point results to integers. It specifies the method of rounding, such as rounding up, down, or to the nearest integer. This parameter is important for ensuring that the node's output values are consistent and within the desired range, especially when precise integer values are required.
The always_execute
parameter is a boolean flag that dictates whether the node should process motion even if no significant changes are detected. When set to True
, the node will always perform its operations, which can be useful for applications that require continuous updates. Setting it to False
can improve efficiency by skipping unnecessary processing.
The int_result
is the primary output of the node, representing the integer value derived from the detected motion. This value is calculated based on the input parameters and the detected changes within the specified ROIs. It is crucial for applications that require a quantifiable measure of motion, as it can be used to trigger actions or adjust settings dynamically. The int_result
is constrained by the minimum_value
and maximum_value
parameters to ensure it remains within the desired range.
The mask
output is a binary image that highlights the areas of the input image where motion has been detected. It serves as a visual representation of the motion analysis, allowing you to see which parts of the image are contributing to the int_result
. The mask is useful for debugging and refining the motion detection process, as it provides immediate feedback on the node's performance.
threshold
parameter to fine-tune the sensitivity of motion detection, balancing between detecting minor movements and ignoring noise.blur_size
parameter to control the level of detail in motion detection, with larger values smoothing out noise but potentially missing small movements.minimum_value
and maximum_value
constraints to ensure the node's output remains within a useful range for your application.rounding_mode
settings to achieve the desired precision and consistency in the node's output values.threshold
parameter is set outside the acceptable range.threshold
to a value between 0 and 255.blur_size
parameter is not an odd integer.blur_size
to an odd integer, such as 3, 5, or 7.rounding_mode
parameter is set to an invalid option.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.