Detecting Cars in a Video of Traffic


SUBMITTED BY: ahm3d7

DATE: May 14, 2016, 5:43 p.m.

FORMAT: Text only

SIZE: 1.8 kB

HITS: 131592

  1. Detecting Cars in a Video of Traffic
  2. This example shows how to detect cars in a video of traffic. You can use Image Processing Toolbox™ to visualize and analyze videos or image sequences. This example uses VideoReader (MATLAB®), implay, and other Image Processing Toolbox functions to detect light-colored cars in a video of traffic. Note that VideoReader has platform-specific capabilities and may not be able to read the supplied Motion JPEG2000 video on some platforms.
  3. Step 1: Access Video with VideoReader
  4. The VideoReader function constructs a multimedia reader object that can read video data from a multimedia file. See the documentation for VideoReader for information on which formats are supported on your platform. Use VideoReader to access the video and get basic information about it.
  5. trafficVid = VideoReader('traffic.mj2')
  6. trafficVid =
  7. VideoReader with properties:
  8. General Properties:
  9. Name: 'traffic.mj2'
  10. Path: '/mathworks/devel/bat/BR2016ad/build/matlab/toolbox/imag...'
  11. Duration: 8
  12. CurrentTime: 0
  13. Tag: ''
  14. UserData: [ ]
  15. Video Properties:
  16. Width: 160
  17. Height: 120
  18. FrameRate: 15
  19. BitsPerPixel: 24
  20. VideoFormat: 'RGB24'
  21. The get method provides more information on the video such as its duration in seconds.
  22. get(trafficVid)
  23. obj =
  24. VideoReader with properties:
  25. General Properties:
  26. Name: 'traffic.mj2'
  27. Path: '/mathworks/devel/bat/BR2016ad/build/matlab/toolbox/imag...'
  28. Duration: 8
  29. CurrentTime: 0
  30. Tag: ''
  31. UserData: [ ]
  32. Video Properties:
  33. Width: 160
  34. Height: 120
  35. FrameRate: 15
  36. BitsPerPixel: 24
  37. VideoFormat: 'RGB24'

comments powered by Disqus