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 Alpha and Beta controls 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

  1. Feed a live camera or video frame stream into the Image Any input.

  2. Tune Threshold to focus on meaningful motion and ignore noise.

  3. Adjust MaxValue to set how strongly each event contributes to the heatmap.

  4. Use Alpha and Beta to balance visibility between the original scene and the colorized heatmap.

  5. 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), or Stream Reader to feed continuous frames.

  • If your input frames are large and you only need an overview, add Image Resize before this block to reduce processing and speed up accumulation.

  • To focus on a specific region, crop with Image ROI or Image ROI Select before feeding frames into this block.

  • If you want a separate foreground mask or additional background models, try combining with Background Subtractor for alternative foreground detection prior to accumulation.

  • Use Show Image to preview the overlay live in the UI.

  • Save results periodically with Image Logger or record sessions with Record Video for post-analysis.

πŸ› οΈ Troubleshooting

  • If the heatmap shows too much noise, increase Threshold and consider preprocessing with Blur or Denoising.

  • If motion areas grow too quickly, lower MaxValue or periodically reset the run to clear old accumulation.

  • If the overlay is too faint or too strong, adjust Alpha and Beta to 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 USB to confirm operation.

Last updated

Was this helpful?