Notices
MEGAsquirt A place to collectively sort out this megasquirt gizmo

Behold! My latest Project! (Map extractor from image files)

Thread Tools
 
Search this Thread
 
Old Jun 11, 2010 | 02:26 PM
  #1  
Jeff_Ciesielski's Avatar
Thread Starter
Elite Member
iTrader: (10)
 
Joined: Oct 2008
Posts: 1,770
Total Cats: 31
From: Rhode Island
Default 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.
Old Jun 11, 2010 | 02:29 PM
  #2  
SKMetalworks's Avatar
Elite Member
iTrader: (7)
 
Joined: Jan 2007
Posts: 1,731
Total Cats: 4
From: Renton Washington
Default

You know, while your at work, your suppose to be working not jacking off on some personal program.
Old Jun 11, 2010 | 02:31 PM
  #3  
wayne_curr's Avatar
Elite Member
iTrader: (8)
 
Joined: Aug 2007
Posts: 2,712
Total Cats: 5
From: Bellingham, Wa
Default

I dont know, all I read was

NerdNerd Nerd Nerdnerdnerdnerd Nerdiness and i'm a nerd.

J/k, very creative lol.
Old Jun 11, 2010 | 02:31 PM
  #4  
Braineack's Avatar
Boost Czar
iTrader: (62)
 
Joined: May 2005
Posts: 80,552
Total Cats: 4,368
From: Chantilly, VA
Default

or you ask someone to export their timing table and you simply import it?
Old Jun 11, 2010 | 02:31 PM
  #5  
Jeff_Ciesielski's Avatar
Thread Starter
Elite Member
iTrader: (10)
 
Joined: Oct 2008
Posts: 1,770
Total Cats: 31
From: Rhode Island
Default

Originally Posted by SKMetalworks
You know, while your at work, your suppose to be working not jacking off on some personal program.
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
Old Jun 11, 2010 | 02:33 PM
  #6  
Jeff_Ciesielski's Avatar
Thread Starter
Elite Member
iTrader: (10)
 
Joined: Oct 2008
Posts: 1,770
Total Cats: 31
From: Rhode Island
Default

Originally Posted by Braineack
or you ask someone to export their timing table and you simply import it?
You can do that too. This is more for my personal amusement and in case anyone else wants to use it. Its free and will be open source, so who cares
Old Jun 11, 2010 | 02:36 PM
  #7  
mgeoffriau's Avatar
Elite Member
iTrader: (7)
 
Joined: Jul 2009
Posts: 7,388
Total Cats: 474
From: Jackson, MS
Default

Apple and Macromedia and Google all just sued you.
Old Jun 11, 2010 | 02:38 PM
  #8  
Braineack's Avatar
Boost Czar
iTrader: (62)
 
Joined: May 2005
Posts: 80,552
Total Cats: 4,368
From: Chantilly, VA
Default

Originally Posted by mgeoffriau
Apple and Macromedia and Google all just sued you.

OCR is nothing new. I bet Adobe Acrobat could get the text for you.
Old Jun 11, 2010 | 02:39 PM
  #9  
neogenesis2004's Avatar
Elite Member
iTrader: (12)
 
Joined: Aug 2006
Posts: 4,413
Total Cats: 20
Default

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.
Old Jun 11, 2010 | 02:42 PM
  #10  
Jeff_Ciesielski's Avatar
Thread Starter
Elite Member
iTrader: (10)
 
Joined: Oct 2008
Posts: 1,770
Total Cats: 31
From: Rhode Island
Default

Originally Posted by mgeoffriau
Apple and Macromedia and Google all just sued you.
I'll be releasing the Iphone App later this year
Old Jun 11, 2010 | 02:43 PM
  #11  
Jeff_Ciesielski's Avatar
Thread Starter
Elite Member
iTrader: (10)
 
Joined: Oct 2008
Posts: 1,770
Total Cats: 31
From: Rhode Island
Default

Originally Posted by neogenesis2004
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.
I'm using the python interface to Google's Tesseract engine for the OCR.

http://code.google.com/p/tesseract-ocr/
Old Jun 11, 2010 | 02:46 PM
  #12  
18psi's Avatar
VladiTuned
iTrader: (76)
 
Joined: Apr 2008
Posts: 35,821
Total Cats: 3,482
Default

I dunno wtf you're talking about but I think I like it
Old Jun 11, 2010 | 02:53 PM
  #13  
neogenesis2004's Avatar
Elite Member
iTrader: (12)
 
Joined: Aug 2006
Posts: 4,413
Total Cats: 20
Default

Originally Posted by Jeff_Ciesielski
I'm using the python interface to Google's Tesseract engine for the OCR.

http://code.google.com/p/tesseract-ocr/
Blah, im going to have to find something standalone then with low memory footprint.
Old Jun 11, 2010 | 02:56 PM
  #14  
mgeoffriau's Avatar
Elite Member
iTrader: (7)
 
Joined: Jul 2009
Posts: 7,388
Total Cats: 474
From: Jackson, MS
Default

Originally Posted by Jeff_Ciesielski
I'll be releasing the Iphone App later this year
Awesome, that way I can be completely superior to everyone around me when I use it.
Old Jun 11, 2010 | 02:56 PM
  #15  
neogenesis2004's Avatar
Elite Member
iTrader: (12)
 
Joined: Aug 2006
Posts: 4,413
Total Cats: 20
Default

well, I downloaded the source. Holy tons of files batman!
Old Jun 11, 2010 | 03:04 PM
  #16  
Jeff_Ciesielski's Avatar
Thread Starter
Elite Member
iTrader: (10)
 
Joined: Oct 2008
Posts: 1,770
Total Cats: 31
From: Rhode Island
Default

Originally Posted by neogenesis2004
well, I downloaded the source. Holy tons of files batman!
I honestly haven't looked at the source yet. The python version basically just comes with a binary version of the engine and spawns new instances of it when it is called.
Old Jun 11, 2010 | 03:11 PM
  #17  
levnubhin's Avatar
Elite Member
iTrader: (30)
 
Joined: Aug 2007
Posts: 7,329
Total Cats: 12
From: Va Beach
Default

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
Old Jun 11, 2010 | 03:14 PM
  #18  
neogenesis2004's Avatar
Elite Member
iTrader: (12)
 
Joined: Aug 2006
Posts: 4,413
Total Cats: 20
Default

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 :(
Old Jun 11, 2010 | 03:16 PM
  #19  
neogenesis2004's Avatar
Elite Member
iTrader: (12)
 
Joined: Aug 2006
Posts: 4,413
Total Cats: 20
Default

Originally Posted by levnubhin
Figure out how to control the MS from my iPhone with TS and then I will be impressed. Lol
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.
Old Jun 11, 2010 | 03:19 PM
  #20  
neogenesis2004's Avatar
Elite Member
iTrader: (12)
 
Joined: Aug 2006
Posts: 4,413
Total Cats: 20
Default

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.



All times are GMT -4. The time now is 12:28 AM.