Skip to content

mig3n/arrow_holes_detection

Repository files navigation

Archery Target Bullet Hole Detection

Introduction

This project provides a comprehensive system for detecting bullet holes in archery target images using a multi-stage image processing pipeline.

Installation

  1. Clone the repository:
git clone https://github.com/your-repo/archery-target-detection.git
  1. Navigate to the project directory:
cd archery-target-detection
  1. Create a virtual environment and activate it:
python -m venv hole_det_venv
source hole_det_venv/bin/activate
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

Processing Pipeline

The project includes a comprehensive processing pipeline implemented in process_pipeline.py. This script chains multiple image processing stages together.

Basic Usage

python process_pipeline.py input.jpg

Custom Output Names

python process_pipeline.py input.jpg \
 --edge-output edges_custom.png \
 --clean-output clean_custom.png \
 --blob-output final_blobs.png

Edge Detection Parameters

python process_pipeline.py input.jpg \
 --blur-size7 7 \
 --canny-low 100 \
 --canny-high 200

Blob Detection Configuration

python process_pipeline.py input.jpg \
 --blob-mode filter \
 --min-area 50 \
 --max-area 5000

Additional Options

python process_pipeline.py input.jpg \
 --keep-intermediate \
 --blob-output results.png

For detailed help and all available options:

python process_pipeline.py --help

Configuration Guide

The detection system uses a multi-stage approach:

  1. Preprocessing: Enhances image quality
  2. Multi-scale Detection: Uses Hough Circle Transform and contour analysis
  3. Target Ring Filtering: Eliminates false positives from target scoring rings
  4. Validation: Filters results based on confidence, darkness, and overlap

Optimal Configuration

Preprocessing Parameters

{
 "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
}

Detection Parameters

{
 "param1": 25,
 "param2": 8,
 "min_radius": 5,
 "max_radius": 50,
 "accum_threshold": 15,
 "max_accu": 30
}

Validation Parameters

{
 "darkness_threshold": 85,
 "confidence_threshold": 0.3,
 "overlap_threshold": 0.7,
 "size_variation_threshold": 0.5,
 "min_hole_intensity": 35,
 "max_hole_intensity": 125
}

Parameter Tuning Guide

For Darker Images / PNG Format

  • Increase min_hole_intensity to 30-35
  • Increase max_hole_intensity to 125-130
  • Decrease darkness_threshold to 80-85

For Lighter Images / JPG Format

  • Decrease min_hole_intensity to 40-45
  • Decrease max_hole_intensity to 115-120
  • Increase darkness_threshold to 85-90

Troubleshooting

Common Issues

  1. Too few holes detected: Check darkness_threshold, min_radius, max_radius
  2. Too many false positives: Increase confidence_threshold, decrease target_ring_tolerance

Technical Details

Detection Algorithm

  • Primary Method: Hough Circle Transform (multi-scale)
  • Secondary Method: Contour analysis for edge cases
  • Validation: Circularity, darkness, and spatial filtering

Support

For issues or questions:

  1. Check parameter tuning guide
  2. Review results.json for detailed detection information
  3. Consider image quality and lighting conditions

Best Practices

  1. Use high-resolution images (minimum 1000x1000 pixels)
  2. Ensure even lighting across the target
  3. Adjust parameters based on target material and color
  4. Review results.json for accuracy
  5. For batch processing, consider parallel processing

About

Detect holes in archery range using python opencv

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages