Example: Dashcam optic flow using Computer Vision Toolbox

버전 1.0.1 (133 MB) 작성자: Adam Danz
A brief description of the steps needed to produce an optic flow field from dashcam footage using Matlab's Computer Vision Toolbox
다운로드 수: 51
업데이트 날짜: 2021/8/16

라이선스 보기

This demo shows a grid of optic flow vectors over a video recorded by a dash camera (dashcam video from 2018, Rochester NY).
Steps to create the video
  1. Each frame of the video was extracted as a jpg image using "Free Video to JPG Converter" (30 fps). Alternatively, each frame could be read into Matlab using VideoReader but I found this to be slower than having the image frames available on file.
  2. Each jpg frame was read into Matlab using read and was converted to grayscale using im2gray.
  3. The motion between grayscale image n and image n-1 was computed using vision.BlockMatcher (Computer Vision Toolbox), set up to return the horizontal and vertical components of motion for each flow vector spaced along a grid.
  4. Any flow vectors with a magnitude of less than 2 were eliminated for each frame to reduce noise. If all flow vectors had 0 magnitude, the frame was a duplicate and was removed.
  5. The remaining optic flow vectors were plotted to the original colored jpg image frames using quiver and the updated image was stored to memory using getframe.
  6. The final updated frames were written to video using VideoWriter.
The avi video has been compressed. Contact me if you'd like the original (0.88 GB). This example video is also available on youtube [link].

인용 양식

Adam Danz (2024). Example: Dashcam optic flow using Computer Vision Toolbox (https://www.mathworks.com/matlabcentral/fileexchange/97652-example-dashcam-optic-flow-using-computer-vision-toolbox), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Optics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.1

Fixed typos in file exchange title. No changes to files.

1.0.0