From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

LabVIEW Motion Tracker VI Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example continuously threshold incoming images and take the sum of the results to provide motion tracking.


Description
This VI continuously thresholds images and takes the sum. It then multiplies the result by a red image. The areas where movement occurred will then show up red. The color that is used for thresholding is chosen by adjusting the sliders on the front panel. The image shown below was taken while tracking the movement of a black dot. Note that this example works best when the object is in front of a solid background. This example can be modified for many different uses including a motion "heat map" feature that highlights areas where motion is more frequent.

Requirements

  • LabVIEW 2012 (or compatible)
  • Vision Acquisition Software
  • Vision Development Module
  • Any camera that is compatible with Vision Acquisition Software


Steps to Implement or Execute Code

  1. Open the VI
  2. Select your camera and Run the VI
  3. Adjust the sliders to select the desired color
  4. Notice how the image on the right tracks the movements of the objects of interest

Additional Information or References
VI Block Diagram

 5-321.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

 

Applications Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Xiantaj
Member
Member
on

Hi
I was trying to use your code for kinect, so far no luck!
can you give me a hint?

here is what I tried to do

https://mega.nz/#!9gJgSTbZ!f60p9hFRIqULBSMcS2pfvdxVaecNLEzOmzuZNnHGORo