ExplOCR: An OCR Application Explorers May Find Useful

Hello Explorers!

I've written an OCR library that will process screenshots of the system map and extract information from the leftmost portion of the screen where object description and detail information are located. You can later browse this information in a sortable grid with filtering.

Unbenannt.jpg

This will allow you to get all detail scan data of the object -- e.g. atmostphere and surface temperature, also including mining reserves and terraforming status -- as a text in either XML or a more human-readable format. My sample application includes a sortable grid with row filters etc.

Current Version: Beta3 "Horizons" Fix 2

Main Features:


  • Puts all information about your discoveries in one location.
  • Easy to use: Just press <Ctrl>-<Alt>-<Shift> with an object selected in the system map, the program does the rest for you.
    When the program presents you the results, click Save to add your screenshot to the archive and data to the database.
  • Directly add a custom description or custom categories separated by newlines.
  • Automatically stitch screenshots that don't fit on a single screen (e.g. rings) together.
  • System name taken from network log, body name within system scanned from the screenshot.
  • Check OCR quality at a glance: Intuitive display of your screenshot underlines "good" letters in green, less good letters in yellow or red.
  • Big friendly Kerbal-coloured button to open the archive browser / table view.
  • Grid view with easy sorting and filtering. Columns selectable.
  • Grid allows editing to correct any reading mistakes. Re-Read the screenshot from archive to restore original.
  • Review your archived screenshots in grid view unsing a handy fold-out tab.
  • Cut & paste data from the grid to your favourite spreadsheet.
  • It is also possible to load screenshots, so you can process an existing archive to extract data.
  • Custom screenshot key combinations. [NEW]
  • Custom database file / screenshot archive directories. This allows per-trip databases. [NEW]
  • Found an interesting planet, e.g. with a thin atmosphere made of gaseous rock? Tell people about it without having to type it off:
SYSTEM Stock 1 Sector MS-S c4-8
BODY 2e
DESCRIPTION Rocky World
EARTH_MASSES [0.0039]
RADIUS [1104] KM
SURFACE_TEMP [131] K
VOLCANISM_TYPE NO VOLCANISM
ATMOSPHERE_TYPE NO ATMOSPHERE
COMPOSITION [91] % ROCK
[9] % METAL
ORBIT_PERIOD [8.5] D
ORBIT_MAJOR [0.01] AU
ORBIT_ECCENTRICITY
[0.0001]
ORBIT_INCLINATION [-0.61] DEG
ORBIT_PERIAPSIS [149.62] DEG
ROTATION_PERIOD [-8.5] D
ROTATION_LOCKED NO
ROTATION_TILT [128.71] DEG


You can get the program at GitHub: https://github.com/ThoroughlyLostExplorer/ExplOCR/releases/download/TagBeta4-1.7/ExplOCRbeta3-for-Guardians2.2.zip
Current version is for 1920x1080 and 1920x1200. I'm looking forward to hearing from you if you need support for another resolution.

I'd like to thank CMDR Finwen who was kind enough to test the program during closed beta!

Please try out the program and let me know what you think. Remember that I rely on your feedback to improve the program.
(Please note the install and usage notes below.)

Best regards,

ThoroughlyLostExplorer


PS: I don't like to announce upcoming features before they are ready. This time around I'll make bit of an an exception and mention that I'm hoping to soon connect to a popular exploration-related website that has an API to post data to it. As always, I'd be glad to hear from more developers about connecting exploration OCR to their programs.


Beta 2 Users Upgrading from Beta 1 or Beta 2: Please read my Sep 13 post!

Additional Information, Program Usage Overview, Limitations:

The library may be of use to explorers who wish to gather and record detailed information about a scanned object in a format that makes it accessible for further processing. Even with just the test application, cutting and pasting from the grid should combine well with your favourite spreadsheet to do anything from statistical analysis to pretty pie graphs of planet types.

My goal in developing the library is primarily to use it for my own favourite gameplay experience, which involves browsing large tables of all the objects I happend to scan. Did you ever wonder what the (in-game) distribution curve of Jovian planet mass is -- uniform, normal, or something else? Well, I'd hate to have to scan 100 new Jovians just because I made up that question after a pint too many. I'm looking to use my previous records to find the answer in this kind of situation.

While this style of gameplay will probably not appeal to many, I've come to think that there may be explorers out there who would have their own, different use of the same data and are, like me, too plain lazy to type it all off. So I've decided to release my library with public license, just in case someone might find it useful.

While the library would most typically be used in a component of somebody's program, or as a tool executable called by that program, I have decided to wrap it up in a .NET executable file to make it easier for others to try it out. This executable file includes a very basic browsable grid so you could e.g. check if any of your bodies break a UC record.

Liability: None.
Not even in-game, don't blame me for any embarrassment: Should you be using this as a tool for UC record hunting, double check any finds ;)

Limitations:
There are a number of things the program might be expected to do but can't do currently. Some of these things it can't do because it is still in beta, and some of these things will never be included unless someone else decides to contribute. Please don't be disappointed if it can't:

  • [*=1]Launch. Or work reliably. Or do anything without a crash. Well, it's a beta. I'll try to patch up bugs as they appear. Chances are it will work for most people without problems.
    [*=1]Work with very high screen resolutions. I use a resolution of 1920x1080. From closed beta I know that 1980x1200 also works. I think that higher resolutions can be made to work in the future.
    [*=1]Work with space stations, powerplay control info etc. The program focuses on exploration, so I will try to ignore any traces of civilisation.
    [*=1]Interpret discovery tags. I ignore them when reading.
    [*=1]Detect object type in every case. It may look trivial, given that the OCR can read numbers rather well, but some object types differ only in one word (star color) and surface temperature. With those, there is a margin of error.
    Type detection should work well in the vast majority of cases, but always keep an eye on the detected object type and possibly PM me -- I might want to see the screen shot that caused it to fix the problem.
    [*=1]Work at 100% accuracy. On my system, accuracy is quite good and much better than my accuracy when typing. I'm looking to progress to "very good accuracy" in due time, and maybe to "uncanny accuracy" if I can make it. Remember, this is a beta!

License:
ExplOCR.exe has an Apache 2.0 license. So its free, you can see the source and do lots of things with it. Note that it uses OpenCV 2.4.10 (for the neural net) and LibEmgu 2.4.10 (for connecting to OpenCV), which have different "free" licenses. I have included their license notes.
Installation: Download theExplOCRbeta1.zip archive from the GitHub link above. Unpack into a directory of your choice. The program itself should work without additional installation. Unfortunately, I'm currently not checking if your system as a whole meets all requirements.
You will need the following:

  • [*=1]ExplOCR.exe uses .NET 4.5. I'm not sure if it will run on systems that have only .NET 4.0. If it doesn't, let me know and I'll try to build against 4.0.
    [*=1]ExplOCR.exe uses OpenCV and LibEmgu, which have requirements of their own. The only thing you need to worry about is having the right Visual C++ runtime installed. I can't legally include those in my GitHub repository (I think). Often, these runtimes will already be present on your system and all will be fine. If something doesn't work, get the "Microsoft Visual C++ 2010 Redistributable" and ""Microsoft Visual C++ 2013 Redistributable" for 32 bit / x86 downloadable from Microsoft free of charge.
    [*=1]For data import when upgrading: Beta1 or Beta2 Users Read post at thread end please!

Usage:

  • [*=1]Start up the program. If all goes well, it will display the main window.
    [*=1]Minimize the program.
    [*=1]When the game is running (preferrably in full-screen borderless mode), select an object in the system map.
    [*=1]Then press <Ctrl>-<Alt>-<Shift> (this is an easy key combo for my program to listen for while it is in the background) to take a screenshot and bring my program to the foreground. Read below on fow to change this combination!
    [*=1]The program window should now look like this:

    Unbenannt2.png
    [*=1] The left portion of the windows is the screenshot. The program has added underlining to showhow well it was able to read letters: Green is good, Red is bad. This will tell you at a glance where any misinterpretation of letters/digits may have occurred.
    The top right portion is where the program will propose system name and body letter/number code. This works well only if you are currently in the system where the screenshot was made beacuse it uses your net log.
    [*=1]The checkbox "Await Image Stitch" tells the program that you are about to take a second screenshot showing a portion of the body information beneath the current one. A typical example are rings, where the ring info often extends beyond what the game can show on the info screen at an time.
    To handle this properly: Make your first screenshot showing the top. Check the checkbox. Clicking Save will minimize the window, but it will keep waiting for the second screenshot. Scroll down in game to show more of the body info. Make second screenshot. Information is stitched together as if it was one screenshot all along. Note that the check box has been unchecked for you. Now save as normal! (In theory, you can chain this but I never found a planet with that many rings...)
    Please note: Use the quick-edit box only after you are done stitching, otherwise you would lose the edited version and stitch to the original.
    [*=1]Beneath the checkbox, you can enter your own custom description and custom category strings. It should be possible to e.g. filter the grid for custom categories. One category per line please.
    [*=1]Shown beneath that is the data in a more human-readable form. You should find everything in the screenshot in this printout (well, everything that I thought was important). The numbers should almost never be misread (-> PM me if you find an example where it is wrong). A number may turn up a 0 if nothing could be read there (-> I'm also interested in these cases, though they are not quite as rare as to justify a PM for each). The Body type should be correct in most cases, though it is sometimes misidentified. Look into Configuration\Descriptions.xml to see what the code for the body type means.
    [*=1]Use the Edit button if something has been misread to fix it before saving.
    [*=1]As an alternative to making a screenshot directly, you can also load a screenshot from file using menu File / Open.
    [*=1]The program will read your net log to determine the system you are in. Configure your log location in menu Config.
    [*=1]Use the Save button or hit return while the body number field has focus to add the XML to a savefile and the screenshot to an archive (-> paths beneath the program's directory).
    [*=1]A quick workflow while supercruising to the next scan is: Open system map, <Ctrl>-<Shift>-<Alt>, Save, <Return> and the program nimizes, putting you back in the system map.
    [*=1]Use the big friendly "Browse Archive" button to stop taking screenshots and browse the archive.Unbenannt3.png
    [*=1]Data table is on the left, selected body data is in the center. The right tab can be folded in or out depending on wether you need it. It shows either the original screenshot or text that represents the current, possibly edited, grid row state.
    [*=1]The table filter uses a format described in Microsoft's documentation for DataView https://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression(v=vs.110).aspx -- e.g. DESCRIPTION LIKE 'Planet*' filters planets.
    [*=1]The page is mainly for browsing. You can also edit, though. To do this, uncheck the ugly nasty looking "Read Only" checkbox. Be sure to backup your data file systems.xml! Editing worked fine for me, but don't come running to me should the program screw up your precious data. Yesssss my preciousss, check box must be checked again so nasssty editses won't ruin our data!
    [*=1]Editing will make the text fields and grid in the center section be available for inputs. In theory, you can even add new lines to the grid. Don't be angry if that doesn't work.
    [*=1]Re-Reading the original screenshot counts as editing.
    [*=1]Use "Save" to write any changes back to the main grid, or "Cancel" ro reset your changes and keep the original main grid data.
    [*=1]Configure the save location of your database "systems.xml" and your screenshot archive in menu item "Config" / "Save Directories" [NEW]
    [*=1]Configure your screenshot key comination in menu item "Config" / "Screenshot Key Combination". This will open a little dialog where you can either select the default combination or record a custom key combo. When recording, it is ok to press the keys sequentially, btw. when choosing a combination, please remmeber that I'll make no attempt that the game is running as active window, so make sure you don't overlap a combination used elsewhere. [NEW]

Feedback: When reporting bugs, please check if the same bug has been reported before. I think GitHub has an error tracker, so you might check there if things have already been reported and then add your bug as an issue. This would help me to fix it.
I'm interested in receiving screenshots that don't work so I can improve accuracy. Since Screenshots tend to be largeish, PM me first to see if I still need samples.
 

Attachments

  • Unbenannt2.png
    Unbenannt2.png
    49 KB · Views: 989
  • Unbenannt3.png
    Unbenannt3.png
    48.7 KB · Views: 766
  • Unbenannt.jpg
    Unbenannt.jpg
    98.2 KB · Views: 1,020
  • Unbenannt.jpg
    Unbenannt.jpg
    317 KB · Views: 807
Last edited:
Wow. This looks great and it looks like me and you have been working on pretty much the same thing. :). I made a website called Elite Galaxy Online www.elitegalaxyonline.com and am getting close to releasing 1.2 which includes this. I posted a news article on the site demoing it just the other day.

I even encountered the same problems as you i.e first discovered data being difficult for tesseract to extract and the identification of object type being very difficult due to having to work just off the object description which is difficult - white dwarfs incredibly so :)

I am very close to being able to go live with it but just this weekend hit a huge problem. My dev system is simply my home computer running windows and so I have a tesseract.exe on there which is used and all works good. However, when porting over to the production webhost system as a test yesterday, I found that nothing is working. I think this is because my web host server is running Linux and my tesseract.exe has been compiled for windows. I think I need to somehow get a tesseract binary compatible for Linux or compile my own which is badly beyond my skill level.

If you had any advice on how I could get over this issue I would be extremely grateful.

I'll definitely be taking your tool for a spin as I'd love to see how our results compare. My own algorithms found that pre processing the images first by upscaling them and performing contrast adjustments helped with the tesseract recognition immensely. Did you manage to train tesseract on the euro caps font?

Sorry, just spouting random questions now but am genuinely in shock to see we have both been working on the same thing :)
 
Last edited:
Wow. This looks great and it looks like me and you have been working on pretty much the same thing. :). I made a website called Elite Galaxy Online www.elitegalaxyonline.com and am getting close to releasing 1.2 which includes this. I posted a news article on the site demoing it just the other day.

I even encountered the same problems as you i.e first discovered data being difficult for tesseract to extract and the identification of object type being very difficult due to having to work just off the object description which is difficult - white dwarfs incredibly so :)

Actually, I don't use tesseract at all. I considered upsampling/tesseract, but before I got that to even remotely work I got some advice that neural nets were better suited for the system map. Since I had never used a neural net before, I decided I'd start with that.

My software uses the OpenCV package (which should be available for linux), plus LibEmGu to connect that with C#. The C# part generally ties my particular application to Windows, but it should be easy to port the OCR backend to e.g. Java or Python and use it on Linux.

My sources are open so you're welcome to look around and see if you can re-use anything. Does your site happen to have an API so I could let people upload their OCR-ed data?

Btw. I think there is also a Tesseract version for Ubuntu, and likely for other Linux distributions as well.
 
Thanks commander, ah ok I know nothing of neural nets so just assumed this must be tesseract. Thanks for your advice on Linux, I'll keep digging. My site does not have an api at this point, I'm a bit new to all this to be honest so didn't design it with that in mind but I'm sure it's possible to add. I just don't quite know where to even start at this point.

I'm gonna try and do this definitely after I get 1.2 done as the tie in between our tools would be amazing. Commanders could capture the data whilst in game using your tool very well and then simply upload it to elite galaxy online if they chose to.

Exciting stuff.
 
Hi Explorers,

I'm currently working on a Beta2 version, which will have both improved accuracy and new features. I'm currently planning to include:

Improved archive browsing/editing, custom descriptions/comments, custom categories, astronomical body code (e.g. A 2 c") detected automatically, auto-stitching of data from several screens (e.g. rings) and an all new graphics display that will tell you at a glance where your OCR is reliable and where it might have gotten something wrong.

Release will be "soon", but I'll be somewhat busy this week so I'd more honestly say "soonish". I guess that makes now the perfect time for you to let me know any feedback or suggestions!

Best,

TLE
 
I have started my journey to Sagittarius A* only the day before yesterday, and already have been a bit anxious what to do with all those screenshots that I am accumulating. So I am very excited by ExplOCR! There's only one minor detail: I am playing on a Mac. :eek:


[...]
While the library would most typically be used in a component of somebody's program, or as a tool executable called by that program, I have decided to wrap it up in a .NET executable file to make it easier for others to try it out. This executable file includes a very basic browsable grid so you could e.g. check if any of your bodies break a UC record.
[...]

From browsing your GitHub repo it looks as if all of your code (both library and UI) is written in C# - excellent! So, I might be tempted to get the library part to run on Mac OS X under Mono, for automated batch processing. Offhand, are you aware of any obstacles that would make this impracticable (e.g. an API you used that is guaranteed to be non-portable)?

I already checked OpenCV and LibEmgu/Emgu CV - officially they should both be available on Mac OS X. Despite this, I am pretty sure there is integration trouble waiting somewhere along the way, but hey, where would be the spice without any of that? :D


[...]
Release will be "soon", but I'll be somewhat busy this week so I'd more honestly say "soonish". I guess that makes now the perfect time for you to let me know any feedback or suggestions!
[...]

Does ExplOCR process different image formats? I'm asking because my screenshots are .bmp files when I let Elite create them with F10, but I get .png files when I use the screenshot functionality of Mac OS X. I usually press F10, but sometimes habit takes over and I use the Mac OS X keyboard shortcut, so my screenshots sometimes are a mixture of .bmp and .png.

Cheers
Herzbube
 
Besides OpenCV and LibEmgu integration a few other things might be an obstacle for a port. I'm using "unsafe" code to get at image content quickly, and some drawing into bitmaps too. Maybe Mono can handle that out of the box, as none of it is unusual. I'm also using System.Drawing.Graphic.CopyFromScreen() to make screenshots directly from the program, I don't know if Mono has that. Everything else is rather basic, and I think I'm only actually using a limited subset of the language without e.g. special .NET 4/4.5 features.

If you are considering a port, maybe also consider Java. It is not compeltely dissimilar to C#, and should support most things I'm using. I'd have started in Java, but I figured I'd be a lot faster in C# because Eclipse has a very unfamiliar feel.

BMP/PNG: I'll make a note that I should test to make sure I accept both formats. Lossy compression like jpg should of course not be used.

Until Beta2 comes out, you may have to use the program-internal screenshots, as it turns out there is a problem with the open-file command and "full sized" scrreenshots. Sorry about that.

Best,

TLE
 
Sounds like a great tool and just what i need for a detailed survey i've just started, but I just tried to run it on Windows 10 without success. The mouse pointer changes to indicate it might be processing but no UI appears. I've tried running under admin privileges and running under windows 8 settings but without success. Any ideas?
 
Hm, looks I better add a crash diagnosis screen. Try running it from a terminal using ExplOCR <screenshotfile>.png output.txt

Unfortunately, noone I know locally has Windows 10 so far, so I can't just check it out.

Most likely some prerequisite is missing. Make sure your program folder is complete. The program uses .NET 4.5, maybe Win10 ships with a different version. Make sure the correct version is installed. Also, please make sure that the correct "Miscrosoft Visual C++ Redistributable" for OpenCV is installed. Unfortunately, open CV isnot quite specific about which one that is -- it appears that either 2010 or 2012 is needed. I'd guess 2012. In any case, and make sure you get the 32 vit version ("x86"). You can get those downloads directly from Microsoft.

You shuld be able to find which of those packages are already installed on your systme in the Control Panel, in english probably "Programs and Features", listed under M for Microsoft.

If all is installed, PM me so we can figure out whats causing the problems without too much clutter here.

There is also a possibility that Microsoft changed the internal mechanisms that take care to find the right system libraries for applications for the new windows versions and there are minor difficulties when running some programs. If that happened, it will be difficult to figure out.

Best,

TLE
 
Update: The standard Beta1 build will work with Windows 10

As I noticed myself when trying out my own download, virus programs will often scan new downloaded programs very thoroughly when you launch them. Some even show a warning message where you need to click to get it running. In fact some versions of windows then go and swallow up the warning message, so it may take some searchig to find it. Of course, be on the safe side and let each layer of security take his turn until all is scanned and they finally agree to show the window.

Plus a note about a remark a few posts back: The program generally does not require administrator rights.

TLE
 
Is there anyway to alter the keybind for this?

No, mostly because I assume I need admin privileges to install a hotkey that works while the program is minimized. Ctrl+Alt+Shift is something I can look at without any special technicalities because they are mode keys. I'm using a defineable key on my keyboard to do the Ctrl+Alt+Shift for me.

Suggestion noted. I may include it sometime after Beta2 unless there is some sort of emergency e.g. you can't use those keys at all. To be quite honest I am still hoping that someone will include my code in a full-fledged explorer application so I can ignore all these configuration and GUI things and get by just writing the OCR part of it.

TLE
 
Hi Explorers,

I've just published the Beta 2 release, which you can find at https://github.com/ThoroughlyLostExplorer/ExplOCR/releases

Basically, you just need to download the ZIP archive for "Beta 2", unpack it and run from that folder.

However, I've just now noticed that this would let Beta1 users start with an empty archive/database. The next version in a few weeks will include a mechanism to handle this automatically, for now please follow these easy...

Upgrade Instructions for Beta1 Users

- Locate your old Beta1-version ExplOCR folder. Rename it to ExplOCR.bak to keep it as a backup.
- Unpack the Beta2 ZIP archive and copy to folder inside to a location of your choice -- typically the same where you were running Beta1.
For simplicity, I'll assume the location is called ExplOCR in the instructions below.
- Locate your existing screenshot directory in the backup: ExplOCR.bak\OCR\screenshots and copy the complete directory to the OCR folder of your new installation to become e.g. ExplOCR\OCR\screenshots
- Locate your database file in the backup: ExplOCR.bak\OCR\save\systems.xml and copy it to the OCR folder of your new installation to become e.g. ExplOCR\OCR\save\systems.xml
- Do not copy the other xml files in the folder, those aren't user data. (I'll really have to move those elsewhere)
- Start the ExplOCR application and open the table view by menu or the inviting green "Browse Archive" button.
- Your previous scans should be there.

Well, I hope it all works. I'll add a list of new features etc. to the original post at the top of this thread. Let me know should anything not work as expected, remember this is a beta. Of course, I'm interested in other feedback and ideas too.

Best regards,

TLE
 
Last edited:
This is awesome, well done. :)

I was thinking of doing something similar a while back, a desktop app for explorers to capture the information of the systems they explore, store it in a DB and then upload it with images to share; only problem was finding a library that worked with my compiler, and which was O.S - unfortunately I was unlucky and gave it up as a bad job; now there's Elite Galaxy Online (the web version of the same idea, lol) and it's a beautiful looking site too. :)

Anyway, awesome someone wrote an OCR tool for this.
 
Last edited:
Great job & nice to another app for exploring.

Will have a closer look later and certainly give it a good go on my next trip out.
 
Back
Top Bottom