1
Motion Detection and Processing Performance Analysis Thomas Eggers, Mark Rosenberg Department of Electrical and Systems Engineering Abstract Abstract Histograms Histograms Methods Acknowledgements Acknowledgements This project involved designing motion detection software. LabVIEW’s NI Vision and Motion software was used to implement the detection. A Firewire camera was used to feed the video to the computer. The software developed has the capabilities of not only reading live camera feed but can also read any AVI file. The software has the ability to detect motion, place a red circle on the center of the region of detected motion, and saves the motion file to a hard drive. The camera operates at 60 fps, and while no motion is detected, the software processes 45 fps. When motion is detected, the software slows, only writing roughly 30 frames per second. The software live feed, and displays where the files will be saved. The detection is also customizable, allowing the user to select the threshold values for when motion is detected, depending on the specific need of the user. 1. The VI has two modes, AVI and CAM, which are selected for with a Boolean switch. 2. First, a path is designated for the processed video output. 15. The frame rate of the output AVI is set to the same for AVI input and 20 for CAM input. 3. The Vision Acquisition subVI grabs frames from either the AVI or the CAM each loop cycle. 4. This option allows the user to write the CAM to AVI unprocessed for comparison with the processed AVI. This pair of unprocessed/processed AVI files can also be compared with the corresponding pair from AVI input. 5. The image is copied to a new path and converted to grayscale (U8) so that differences between frames are simplified to one parameter. 6. The previous frame is copied to a new path and compared to the current image. The pixels of the resulting image have grayscale values that reflect the difference between the current and previous images. 7. The image is filtered by a threshold and each pixel is represented by a black or red bit. 8. The centroid is calculated for all pixels above the threshold, and the coordinates are calculated for the circle which will be overlaid onto the output images. 9. The number of pixels that showed motion above the threshold is calculated and stored. 10. If the last 8 frames average at least 150 changed pixels, then a Boolean is toggled for processing the motion. 11. The original frame is cleared from any overlays and a timestamp is overlaid at constant coordinates. 12. The circle is overlai d at the centroi d of the motion. 14. After the input AVI file is done being processed, or the CAM is stopped, the VI ends. 13. The processe d frame is written to an AVI output file. 22. Averages and standard deviations are calculated from the array. 16. The VI is separat ed with a sequenc e structu re. 17. Timers flank regions whose performance is being analyzed. 18. The difference in time between two timers is calculated . 19. If it is greater than the maximum or less than the minimum, it replaces them. 20. Each loop cycle, differences are added to an array. 21. The array is represented with a histogram. 6 Write AVI AVI CAM No Motion Motion 1 Acquisitio n AVI CAM No Motion 2 Subtract AVI CAM No Motion 3 Threshold AVI CAM No Motion 4 Centroid AVI CAM No Motion 5 Quantify AVI CAM No Motion AVI CAM Motion No Motion Motion No Motion Component s Avg (ms) Std Dev Avg (ms) Std Dev Avg (ms) Std Dev Avg (ms) Std Dev Acquisiti on - - 33.6 8.57 - - 19.7 1.26 Subtract - - 0.437 0.497 - - 0.506 0.499 9 Threshold - - 0.317 0.464 - - 0.144 0.351 Centroid - - 0.566 0.496 - - 0.485 0.499 Quantify - - 2.02 0.149 - - 2 0.162 Write AVI 8.34 1.93 0 0 9.12 2.1 0 0.025 8 Sum 45.2 8 36.94 31.95 5 22.83 5 Results Results We thank Dr. Robert Morley, Ed Richter, Kristen Heck, National Instruments, the Department of Electrical and Systems Engineering, and Washington University in St. Louis This table shows a summary of average times for each part of the analysis.

Motion Detection and Processing Performance Analysis Thomas Eggers, Mark Rosenberg

Embed Size (px)

DESCRIPTION

Motion Detection and Processing Performance Analysis Thomas Eggers, Mark Rosenberg Department of Electrical and Systems Engineering. Histograms. Methods. Abstract. - PowerPoint PPT Presentation

Citation preview

Page 1: Motion Detection and Processing Performance Analysis Thomas Eggers, Mark Rosenberg

Motion Detection and Processing Performance AnalysisThomas Eggers, Mark Rosenberg

Department of Electrical and Systems Engineering

AbstractAbstract HistogramsHistogramsMethods

AcknowledgementsAcknowledgements

This project involved designing motion detection software. LabVIEW’s NI Vision and Motion software was used to implement the detection. A Firewire camera was used to feed the video to the computer. The software developed has the capabilities of not only reading live camera feed but can also read any AVI file. The software has the ability to detect motion, place a red circle on the center of the region of detected motion, and saves the motion file to a hard drive. The camera operates at 60 fps, and while no motion is detected, the software processes 45 fps. When motion is detected, the software slows, only writing roughly 30 frames per second. The software includes a GUI which shows the live feed, and displays where the files will be saved. The detection is also customizable, allowing the user to select the threshold values for when motion is detected, depending on the specific need of the user.

1. The VI has two modes, AVI and CAM, which are selected for with a Boolean switch.

2. First, a path is designated for the processed video output.

15. The frame rate of the output AVI is set to the same for AVI input and 20 for CAM input.

3. The Vision Acquisition subVI grabs frames from either the AVI or the CAM each loop cycle.

4. This option allows the user to write the CAM to AVI unprocessed for comparison with the processed AVI. This pair of unprocessed/processed AVI files can also be compared with the corresponding pair from AVI input.

5. The image is copied to a new path and converted to grayscale (U8) so that differences between frames are simplified to one parameter.

6. The previous frame is copied to a new path and compared to the current image. The pixels of the resulting image have grayscale values that reflect the difference between the current and previous images.

7. The image is filtered by a threshold and each pixel is represented by a black or red bit.8. The centroid is

calculated for all pixels above the threshold, and the coordinates are calculated for the circle which will be overlaid onto the output images. 9. The number of

pixels that showed motion above the threshold is calculated and stored.

10. If the last 8 frames average at least 150 changed pixels, then a Boolean is toggled for processing the motion. 11. The original

frame is cleared from any overlays and a timestamp is overlaid at constant coordinates.

12. The circle is overlaid at the centroid of the motion.

14. After the input AVI file is done being processed, or the CAM is stopped, the VI ends.

13. The processed frame is written to an AVI output file.

22. Averages and standard deviations are calculated from the array.

16. The VI is separated with a sequence structure.

17. Timers flank regions whose performance is being analyzed.

18. The difference in time between two timers is calculated.

19. If it is greater than the maximum or less than the minimum, it replaces them.

20. Each loop cycle, differences are added to an array.

21. The array is represented with a histogram.

6 Write AVI AVI CAM

No Motion

Motion

1 Acquisition AVI CAM

No Motion

2 Subtract AVI CAM

No Motion

3 Threshold AVI CAM

No Motion

4 Centroid AVI CAM

No Motion

5 Quantify AVI CAM

No Motion

AVI CAM

Motion No Motion Motion No Motion

Components

Avg (ms) Std Dev Avg (ms) Std Dev Avg (ms) Std Dev Avg (ms) Std Dev

Acquisition - - 33.6 8.57 - - 19.7 1.26

Subtract - - 0.437 0.497 - - 0.506 0.4999

Threshold - - 0.317 0.464 - - 0.144 0.351

Centroid - - 0.566 0.496 - - 0.485 0.499

Quantify - - 2.02 0.149 - - 2 0.162

Write AVI 8.34 1.93 0 0 9.12 2.1 0 0.0258

Sum 45.28 36.94 31.955 22.835

ResultsResults

We thank Dr. Robert Morley, Ed Richter, Kristen Heck, National Instruments, the Department of Electrical and Systems Engineering, and Washington University in St. Louis

This table shows a summary of average times for each part of the analysis.