This project provides a comprehensive system for detecting bullet holes in archery target images using a multi-stage image processing pipeline.
- Clone the repository:
git clone https://github.com/your-repo/archery-target-detection.git- Navigate to the project directory:
cd archery-target-detection- Create a virtual environment and activate it:
python -m venv hole_det_venv
source hole_det_venv/bin/activate- Install the required dependencies:
pip install -r requirements.txtThe project includes a comprehensive processing pipeline implemented in process_pipeline.py. This script chains multiple image processing stages together.
python process_pipeline.py input.jpgpython process_pipeline.py input.jpg \
--edge-output edges_custom.png \
--clean-output clean_custom.png \
--blob-output final_blobs.pngpython process_pipeline.py input.jpg \
--blur-size7 7 \
--canny-low 100 \
--canny-high 200python process_pipeline.py input.jpg \
--blob-mode filter \
--min-area 50 \
--max-area 5000python process_pipeline.py input.jpg \
--keep-intermediate \
--blob-output results.pngFor detailed help and all available options:
python process_pipeline.py --helpThe detection system uses a multi-stage approach:
- Preprocessing: Enhances image quality
- Multi-scale Detection: Uses Hough Circle Transform and contour analysis
- Target Ring Filtering: Eliminates false positives from target scoring rings
- Validation: Filters results based on confidence, darkness, and overlap
{
"gamma_correction": 1.2,
"clahe_clip_limit": 4.0,
"clahe_grid_size": [8,8],
"morph_kernel_size": 2,
"morph_iterations": 2,
"blur_kernel": [3,3],
"blur_sigma": 0
}{
"param1": 25,
"param2": 8,
"min_radius": 5,
"max_radius": 50,
"accum_threshold": 15,
"max_accu": 30
}{
"darkness_threshold": 85,
"confidence_threshold": 0.3,
"overlap_threshold": 0.7,
"size_variation_threshold": 0.5,
"min_hole_intensity": 35,
"max_hole_intensity": 125
}- Increase
min_hole_intensityto 30-35 - Increase
max_hole_intensityto 125-130 - Decrease
darkness_thresholdto 80-85
- Decrease
min_hole_intensityto 40-45 - Decrease
max_hole_intensityto 115-120 - Increase
darkness_thresholdto 85-90
- Too few holes detected: Check
darkness_threshold,min_radius,max_radius - Too many false positives: Increase
confidence_threshold, decreasetarget_ring_tolerance
- Primary Method: Hough Circle Transform (multi-scale)
- Secondary Method: Contour analysis for edge cases
- Validation: Circularity, darkness, and spatial filtering
For issues or questions:
- Check parameter tuning guide
- Review results.json for detailed detection information
- Consider image quality and lighting conditions
- Use high-resolution images (minimum 1000x1000 pixels)
- Ensure even lighting across the target
- Adjust parameters based on target material and color
- Review results.json for accuracy
- For batch processing, consider parallel processing