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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Motion detection using webcam

Hello,

 

Im fairly new to labview & got a university project related to the subject.

The basic outline of the project is to:

 

Use a webcam to detect motion

After the motion is detected, a motor connected underneath the webcam should turn on and follow the moving object(i.e it should rotate left if the object goes left and so on)

 

What i plan to do is first of all work on detecting motion only.

Im attaching the block diagram & VI of what i hv done uptil now.Right now as soon as the VI starts, the webcam takes a still image and stores it, and at the same time keeps grabbing live video stream.

 

Now, i want to subtract these two images and give the output to an LED which will turn On everytime it detects a motion, but i dont know how will i be able to do this. I cant understand how to get a simple true/false output from the subtract option.

 

 

Please advice.

 

Aamer

 

 

Download All
0 Kudos
Message 1 of 3
(4,080 Views)

First piece of advice is to search the forum.  There have been lots of discussions about webcams here before.

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 2 of 3
(4,050 Views)

Hi Aamer:

 

Like Matt said, I would spend some time searching the forums for some other methods for motion detection.  Instead of the subtract function, I think you'll be better off doing some object detection and then do you tracking on it.

 

Also, just a general programming tip, it does no good to have your subtract function outside of your while loop like it currently is.  No images will come out and go to the subtract function until you stop the while loop.  Even then, you will only get one image.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 3 of 3
(4,021 Views)