Giter VIP home page Giter VIP logo

bibnumber's Introduction

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:

  • Canny edge detection
  • Stroke Width Transform (to locate text)
  • Text candidates filtering (to detect possible bib numbers)
  • Rotation (to correct moderate skew in bib images)
  • OCR (to convert text image to bib number)

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

  • in the first stage, only bib numbers with 3 digits or more are detected
  • in the second stage, the 3+-digit bib images are used to train a HOG+SVM bib detector
  • in the third stage, the HOG+SVM detector is used to detect 2-digit bib numbers

Installation

The following libraries should be installed to build Bibnumber:

  • Tesseract
  • OpenCV 2.4.x
  • Boost
  • Leptonica

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.

bibnumber's People

Contributors

gheinrich avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.