This project is a C++ application designed for autonomous racing cone detection using OpenCV. It identifies blue, orange, and yellow track cones in both static images and video files, and draws track boundaries to visualize the path.
If you want to see how i did it, check out the Report.
- Color-Based Detection: Uses HSV color space filtering for robust cone identification.
- Contour Processing: Refined mask operations (Closing, Dilating) to extract clean cone shapes.
- Track Visualization: Draws the center points of cones and connects them to represent track boundaries.
- Multi-Format Support: Includes separate executables for image and video processing.
- HSV Tuning Tool: Includes a trackbar utility to fine-tune color threshold values.
- OpenCV: OpenCV library installed on your system.
- CMake: Version 3.16 or higher.
- C++ Compiler: A compiler supporting C++11 or later.
- Clone the Repository:
git clone [repository-url] cd ConeDetection - Configure and Build:
cmake -B build cmake --build build
After building, navigate to the build directory to run the executables:
Processes a sample image from the assets folder:
./build/detect_imageProcesses a video file to visualize cone detection in real-time tracking:
./build/detect_videoRun this tool to interactively adjust HSV values for better thresholding:
./build/run_trackbarsassets/: Contains sample images and videos.conedetection_image/: Source code for image-based detection.conedetection_video/: Source code for video-based detection.conedetection_trackbars/: Utility for tuning HSV parameters.CMakeLists.txt: Build configuration file.