This is a simple C++ program using OpenCV to detect cars in a video stream.
- OpenCV (>= 3.0)
git clone https://github.com/SkxPhan/CarVision.gitcd CarVision
mkdir build && cd build
cmake ..
make./CarVision ../data/video.mp4
The program performs the following steps:
- Read the input video file.
- Apply background subtraction to detect moving objects (cars).
- Perform thresholding to create a binary mask.
- Perform erosion and dilation to reduce noise and smooth contours.
- Find contours of objects in the binary mask.
- Filter contours based on minimum area to detect cars.
- Draw bounding boxes around detected cars and label them.
- Display the processed frames with detected cars in real-time.
bgmaskThreshold: Threshold value for background binary mask.erosionDilationIterations: Number of iterations for erosion and dilation.minContourArea: Minimum contour area threshold for detecting cars.
This project is licensed under the MIT License - see the LICENSE file for details.
