gheinrich / bibnumber

Recognize bib numbers from racing photos
118 stars 39 forks source link

Bibnumber: automatic bib number recognition from racing photos

Bibnumber automatically recognizes bib number from racing photos. As an example, consider this photo: Example

Calling bibnumber on this example will produce the following output:

 [ 38 46 54 69 164 773 775]

Bibnumber also creates small images out of the recognized bibs:

Bib1 Bib2 Bib3 Bib4 Bib5 Bib6 Bib7

Implementation overview

Bibnumber is tuned for high accuracy rather than high recall. Therefore it is not unusual for a bib to be missing in the output however wrong bib numbers are unusual. Since the algorithm precision is low on single-digit bib numbers, those are ignored.

The general pipeline is as follows:

The precision of the algorithm is low for short bibnumbers (less than 3 digits). Therefore, the processing can split into three stages:

Installation

The following libraries should be installed to build Bibnumber:

To build the project:

make -C bibnumber/Debug

Command line

./bibnumber [-train dir] [-model svmModel.xml] image_file|folder_path|csv_ground_truth_file

Bibnumber can either process whole directories or individual images files. To automatically quantify the quality of bib detections, a ground truth .csv file can be used and Bibnumber will display the F-score when done.

In order to train a HOG+SVM bib detector from a number of bib images, the training directory may be specified and Bibnumber will create the SVM model.xml file, which can then be used in a second pass to detect shorter bib numbers (2 letters) with better accuracy.