Behold! My latest Project! (Map extractor from image files)
#1
Elite Member
Thread Starter
iTrader: (10)
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
Behold! My latest Project! (Map extractor from image files)
Don't you hate it when you want to give somebody's timing map a shot, but you are too ******* lazy to manually transcribe it over from the screenshot that they posted? Me too!
In fact, I'm so lazy, that I decided to write a program to do it for me
It is about 85% complete at this point, but thus far does exactly what I want it to.
Here is the breakdown.
Someone posts this online:
You decide that you want to give it a shot.
You right click and copy that image and paste it into mspaint/gimp/photoshop/whatever.
Then, you need to select only the portion of the map that contains values, leave the scale portions out of it, create a new image, and paste that in. Then save it to a directory you can find easily. Basically, you want to end up with this:
The program goes through and whites out everything that isn't numeric, leaving you with this:
(I'm still playing around with various color thresholds to reduce artifacts and fragmenting)
THEN
It uses OCR (Optical Character Recognition) to rip the numbers out of that image in a text format. This is as far as I've gotten as of right now:
The end result will most likely have a GUI (based on either WxWidgets or GTK, I haven't decided yet) and will automatically be able to generate .vex files (you decide the scale at runtime) and will be able to handle ms1 and ms2 maps.
Back to work for now, I'll post up progress and a final version when I'm done.
In fact, I'm so lazy, that I decided to write a program to do it for me
It is about 85% complete at this point, but thus far does exactly what I want it to.
Here is the breakdown.
Someone posts this online:
You decide that you want to give it a shot.
You right click and copy that image and paste it into mspaint/gimp/photoshop/whatever.
Then, you need to select only the portion of the map that contains values, leave the scale portions out of it, create a new image, and paste that in. Then save it to a directory you can find easily. Basically, you want to end up with this:
The program goes through and whites out everything that isn't numeric, leaving you with this:
(I'm still playing around with various color thresholds to reduce artifacts and fragmenting)
THEN
It uses OCR (Optical Character Recognition) to rip the numbers out of that image in a text format. This is as far as I've gotten as of right now:
The end result will most likely have a GUI (based on either WxWidgets or GTK, I haven't decided yet) and will automatically be able to generate .vex files (you decide the scale at runtime) and will be able to handle ms1 and ms2 maps.
Back to work for now, I'll post up progress and a final version when I'm done.
#5
Elite Member
Thread Starter
iTrader: (10)
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
The boats left yesterday, nothing is on fire, so I have some time to kill. This is actually work related (In a way) because I'll be using the same OCR engine in an archiving project later this year. We have 10's of thousands of paper copies of purchase orders kicking around our office, but no digital copies. The other project I'm working on will automatically convert them to digital images, then use OCR to sort and archive them in a database. I needed some practice and results to show my bosses :P
#11
Elite Member
Thread Starter
iTrader: (10)
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
Where did you get the ocr engine? Is it OS, in C/++, and whats the overhead? I've actually been thinking about a small personal project I want to use something similar using a spare camera and arduino in real time. I might be able to adapt that OCR for my use if you have the source.
http://code.google.com/p/tesseract-ocr/
#13
I'm using the python interface to Google's Tesseract engine for the OCR.
http://code.google.com/p/tesseract-ocr/
http://code.google.com/p/tesseract-ocr/
#17
Figure out how to control the MS from my iPhone with TS and then I will be impressed. Lol
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
#18
Well, the source is like a 5.5MB footprint. Probably much less in binary. How large is the executable you downloaded? Also, it only supports TIFF and some BMPs which blows my nuts. Why it doesn't support RAW binary images is beyond me.... If it did I could probably store it on external memory and call it from there. sadface :(
#19
You would bypass TS and directly talk to the MS. He'd essentially have to make a new TS for Iphone. Talking with the MS would actually be the easy part. Its just serial communication. Making all the menus and GUI that works intuitively and looks good would be the hard part. I'm sure it can be done though if someone had the time. Would be sweet to do over BT with a BT to serial adapter connected to the MS.
#20
Wouldn't take too much to connect this to MS. You'd have to engineer a method of marrying it to your phone though.
http://www.sparkfun.com/commerce/pro...oducts_id=9913
PS: I love that site. If you're into embedded stuff you will <3 it.
http://www.sparkfun.com/commerce/pro...oducts_id=9913
PS: I love that site. If you're into embedded stuff you will <3 it.