Optical Flow Composite (Global Align):
The OpticalFlowComposite node is designed to enhance image processing by aligning and compositing images using optical flow techniques. This node is particularly useful for detecting and aligning changes between an original and a generated image, ensuring that any modifications are accurately captured and integrated. By leveraging optical flow, the node can track pixel movements between frames, allowing for precise alignment even in the presence of motion. This capability is crucial for applications where maintaining the integrity of changes is essential, such as in video editing or image enhancement tasks. The node's primary goal is to provide a seamless and accurate composite of images, minimizing artifacts and ensuring that changes are both detected and aligned with high precision.
Optical Flow Composite (Global Align) Input Parameters:
flow_quality
This parameter determines the accuracy of the optical flow alignment between the original and generated images. It offers three options: "medium," "fast," and "ultrafast." Higher quality settings provide more precise change detection and alignment but at the cost of slower processing. Conversely, lower quality settings speed up processing but may miss subtle shifts or produce noisier masks. The default value is "medium."
occlusion_threshold
This parameter sets the sensitivity to pixels that have moved significantly and cannot be reliably matched between images. Higher values ignore more motion discrepancies, reducing false positives from camera jitter but potentially missing real edits. Lower values flag more pixels as changed, catching more edits but possibly over-detecting in noisy areas. The range is from -1.0 to 20.0, with a default of -1.0 for automatic tuning.
close_radius_pct
This parameter controls the filling of small holes and gaps inside the detected edit region. Higher values close larger gaps, creating a more solid, continuous mask, while lower values leave small holes intact, preserving finer mask detail but potentially leaving speckled artifacts. The range is from 0.0 to 5.0, with a default value of 0.5.
Optical Flow Composite (Global Align) Output Parameters:
result
This output is the final composited image, where the original and generated images are aligned and blended based on the detected changes. It represents the seamless integration of modifications, ensuring that the output maintains the intended edits with minimal artifacts.
composite_mask
The composite mask is a crucial output that indicates the regions of change between the original and generated images. It helps in understanding which areas have been modified and to what extent, providing a visual representation of the detected changes.
stats
This output provides a set of statistics about the compositing process, including the percentage of changed pixels, the number of occluded pixels, the mean and 99th percentile of flow magnitude, the median delta E, the resolution, and the diagonal in pixels. These statistics offer insights into the effectiveness and precision of the compositing process.
Optical Flow Composite (Global Align) Usage Tips:
- For tasks requiring high precision in change detection, use the "medium" or higher flow quality setting to ensure accurate alignment and minimal artifacts.
- If you notice excessive noise or false positives in the output, consider adjusting the occlusion threshold to a higher value to ignore minor discrepancies.
- To maintain finer details in the mask, use a lower close radius percentage, but if you need a more solid mask, increase this value to close larger gaps.
Optical Flow Composite (Global Align) Common Errors and Solutions:
"Affine transformation matrix could not be estimated"
- Explanation: This error occurs when the node fails to compute a reliable affine transformation matrix due to insufficient or unreliable matching points between the images.
- Solution: Ensure that the input images have enough distinct features for matching. You may also try adjusting the flow quality to a higher setting for better alignment.
"Flow calculation failed"
- Explanation: This error indicates that the optical flow calculation did not succeed, possibly due to incompatible image sizes or formats.
- Solution: Verify that the input images are of the same size and format. If the issue persists, try using different flow quality settings or preprocessing the images to enhance feature detection.
