PRFTDigitalLabs / SuperNova-OCR

A method for detecting scores from pre-DMD era pinball machines with OpenCV and SSOCR

Home Page:https://blog.truthlabs.com/making-pinball-fun-to-watch-and-play-47943467d7f5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SuperNova OCR

A method for detecting scores from pre-DMD era pinball machines with OpenCV and SSOCR

This was written and tested on a MacBook Pro running OSX 10.11.4. Installing the prerequisites (and their prerequisites) may not work as expected in other environments.

Installation

first, take a look at install.sh to make sure you understand what it's doing. You may want to comment out some lines if you already have some of the components (e.g. Node.js) installed. After you have reviewed it...

run sh install.sh from the root folder to download and install the necessary components. If you have any trouble with them, please contact their maintiners:

Testing

The install script should also launch node server/test.js which will test to make sure that both openCV and SSOCR are installed and running correctly. Use any error messages generated by those commands to track down the source of the problem.

Run the entire process via node server/watcher-test.js. You should see a window with the Firepower backglass displayed, and the scores being output to the console window.

Configuration

in watcher.js, the following changes can be made:

OpenCV Parameters:

  self.CVoptions = {
    camWidth: 1280,
    camHeight: 720,
    interval: 50, // refresh (polling) rate
    maskLowThresh: 0,
    maskHighThresh: 1,
    threshold: 175, // http://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html?highlight=threshold#double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type)
    blurRadius: 3,
    maskFile: 'firepower-4player-mask.png'
    //maskFile: 'firepower-1player-mask.png' // try changing this for just 1 player score
  };

To use your webcam as an input source, modify these lines:

      //to use your webcam, uncomment this line, and comment out the test code below
      
      //self.camera = new cv.VideoCapture(self.settings.index);

      var testMOV = path.join(__dirname, 'img', 'firepower-4player.mp4');
      console.log(testMOV);
      self.camera = new cv.VideoCapture(testMOV);

About

A method for detecting scores from pre-DMD era pinball machines with OpenCV and SSOCR

https://blog.truthlabs.com/making-pinball-fun-to-watch-and-play-47943467d7f5


Languages

Language:JavaScript 89.6%Language:Shell 10.4%