HeatMap
This function block visualizes where motion accumulates over time in a fixed field of view. It creates a color overlay showing areas with frequent movement, useful for surveillance, traffic analysis, or activity heatmapping.
π₯ Inputs
Image Any Grayscale or color image stream to analyze for motion.
π€ Outputs
Image Any Color image with a heatmap overlay that highlights areas with frequent motion.
πΉοΈ Controls
Threshold Adjusts the sensitivity for foreground detection. Higher values make the block ignore small changes and focus on stronger motion.
MaxValue Controls how much each detected motion event adds to the accumulated heatmap. Larger values increase the contribution of each event.
Alpha Controls the weight of the original first frame when overlaying the color heatmap. Lower values make the overlay stronger.
Beta Controls the weight of the colorized accumulated motion map when overlaying. Higher values make the heatmap more prominent.
βοΈ Running mechanism
On first run the block captures and preserves the first frame as a background reference.
For subsequent frames it computes foreground pixels and thresholds them to detect motion events.
Detected motion pixels are accumulated into a single internal image over time.
The accumulated image is colorized and blended with the preserved first frame using the
AlphaandBetacontrols to produce the final overlay.The block continues accumulating until the run is stopped or the block is reset.
π― Features
Continuous accumulation for long-term motion heatmaps.
Simple control set for balancing sensitivity and visualization strength.
Real-time overlay to see where most activity occurs in the scene.
Built-in hard reset handling to clear accumulated data between runs.
π Usage instructions
Feed a live camera or video frame stream into the
Image Anyinput.Tune
Thresholdto focus on meaningful motion and ignore noise.Adjust
MaxValueto set how strongly each event contributes to the heatmap.Use
AlphaandBetato balance visibility between the original scene and the colorized heatmap.Stop or reset the run when you want to clear the accumulated heatmap.
π‘ Tips and Tricks
For live camera sources, pair this block with
Camera USB,Camera IP (ONVIF), orStream Readerto feed continuous frames.If your input frames are large and you only need an overview, add
Image Resizebefore this block to reduce processing and speed up accumulation.To focus on a specific region, crop with
Image ROIorImage ROI Selectbefore feeding frames into this block.If you want a separate foreground mask or additional background models, try combining with
Background Subtractorfor alternative foreground detection prior to accumulation.Use
Show Imageto preview the overlay live in the UI.Save results periodically with
Image Loggeror record sessions withRecord Videofor post-analysis.
π οΈ Troubleshooting
If the heatmap shows too much noise, increase
Thresholdand consider preprocessing withBlurorDenoising.If motion areas grow too quickly, lower
MaxValueor periodically reset the run to clear old accumulation.If the overlay is too faint or too strong, adjust
AlphaandBetato achieve the desired visual balance.If no motion is detected, verify the input frames are changing and are not identical; try feeding a live camera source like
Camera USBto confirm operation.
Last updated
Was this helpful?