Jump to content

Screenshot Data Extractor


6 replies to this topic

#1 zagibu

    Member

  • PipPipPipPipPipPipPipPipPip
  • 2,253 posts

Posted 14 August 2016 - 01:38 PM

I've written a python script that scans end of round screenshots and spits out the text of the data: https://www.dropbox....istics.zip?dl=0
It only works with 1920x1080 screenshots at the moment (although you could create your own patterns for different resolutions). Also, it simply prints the text into the console.

The zip includes 4 example screenshots and can be run from a console by entering "python extract.py". It requires Python 3.x and the pillow image library to run. Maybe i'll look for some form of packager or installer later to make it easier to run.

I mostly did this to prove myself that I could do it. I'll probably add some form of CSV export later, so that the data can be easily imported into spreadsheet applications for further processing. I probably won't have time in the immediate future, which is why I'm posting it in the current state.

Would be interesting to hear if it works on your own screenshots, too.

Edited by zagibu, 15 August 2016 - 02:41 AM.


#2 Mechteric

    Member

  • PipPipPipPipPipPipPipPipPipPip
  • Overlord
  • Overlord
  • 7,308 posts
  • LocationRTP, NC

Posted 14 August 2016 - 03:05 PM

Neato, you should open source it and put it on GitHub or something!

#3 zagibu

    Member

  • PipPipPipPipPipPipPipPipPip
  • 2,253 posts

Posted 14 August 2016 - 03:48 PM

It is open source. MIT license.

#4 itsGreyspot

    Member

  • PipPip
  • Knight Errant
  • Knight Errant
  • 29 posts

Posted 14 August 2016 - 04:11 PM

Awesome! I can't wait to try it, thank you!

Edit to add: After installing Python on Windows install Pillow by simply typing "easy_install Pillow" in the command prompt window. I tried in the script editor without luck.

Edit edit: I'll have to screen cap at the right size, but this is neat.

Edited by itsGreyspot, 14 August 2016 - 04:38 PM.


#5 zagibu

    Member

  • PipPipPipPipPipPipPipPipPip
  • 2,253 posts

Posted 14 August 2016 - 05:55 PM

I you already have a library of screenshots, you could also create your own patterns from them. Take a look at those included. It can be a bit fiddly sometimes because of antialiasing, so that you have to take multiple samples of each characters. There are also some characters that are problematic next to each other, like the L and T, which is why I had to use special shorter patterns to identify them in this case.

Maybe you could also get away with scaling the included patterns. It might not work, but it's worth a try if you have a batch-resize program that can do cubic scaling.

#6 zagibu

    Member

  • PipPipPipPipPipPipPipPipPip
  • 2,253 posts

Posted 14 August 2016 - 06:17 PM

Hmmm, I've just run it on a batch of new screenshots, and there are still some problems. For one, it crashes when the match featured disconnected players. And there are also some more special cases in mech names which have to be dealt with, e.g. a V next to an A.

#7 zagibu

    Member

  • PipPipPipPipPipPipPipPipPip
  • 2,253 posts

Posted 15 August 2016 - 02:41 AM

I updated the zip in the OP with a fix for the disconnected issue and some new patterns for more special cases.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users