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

You know, while your at work, your suppose to be working not jacking off on some personal program.
SKMetalworks is offline  
Old 06-11-2010, 02:31 PM
  #3  
Elite Member
iTrader: (8)
 
wayne_curr's Avatar
 
Join Date: Aug 2007
Location: Bellingham, Wa
Posts: 2,712
Total Cats: 4
Default

I dont know, all I read was

NerdNerd Nerd Nerdnerdnerdnerd Nerdiness and i'm a nerd.

J/k, very creative lol.
wayne_curr is offline  
Old 06-11-2010, 02:31 PM
  #4  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

or you ask someone to export their timing table and you simply import it?
Braineack is offline  
Old 06-11-2010, 02:31 PM
  #5  
Elite Member
Thread Starter
iTrader: (10)
 
Jeff_Ciesielski's Avatar
 
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
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
Jeff_Ciesielski is offline  
Old 06-11-2010, 02:33 PM
  #6  
Elite Member
Thread Starter
iTrader: (10)
 
Jeff_Ciesielski's Avatar
 
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
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
Jeff_Ciesielski is offline  
Old 06-11-2010, 02:36 PM
  #7  
Elite Member
iTrader: (7)
 
mgeoffriau's Avatar
 
Join Date: Jul 2009
Location: Jackson, MS
Posts: 7,388
Total Cats: 474
Default

Apple and Macromedia and Google all just sued you.
mgeoffriau is offline  
Old 06-11-2010, 02:38 PM
  #8  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
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.
Braineack is offline  
Old 06-11-2010, 02:39 PM
  #9  
Elite Member
iTrader: (12)
 
neogenesis2004's Avatar
 
Join Date: 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.
neogenesis2004 is offline  
Old 06-11-2010, 02:42 PM
  #10  
Elite Member
Thread Starter
iTrader: (10)
 
Jeff_Ciesielski's Avatar
 
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
Default

Originally Posted by mgeoffriau
Apple and Macromedia and Google all just sued you.
I'll be releasing the Iphone App later this year
Jeff_Ciesielski is offline  
Old 06-11-2010, 02:43 PM
  #11  
Elite Member
Thread Starter
iTrader: (10)
 
Jeff_Ciesielski's Avatar
 
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
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/
Jeff_Ciesielski is offline  
Old 06-11-2010, 02:46 PM
  #12  
VladiTuned
iTrader: (76)
 
18psi's Avatar
 
Join Date: Apr 2008
Posts: 35,821
Total Cats: 3,481
Default

I dunno wtf you're talking about but I think I like it
18psi is offline  
Old 06-11-2010, 02:53 PM
  #13  
Elite Member
iTrader: (12)
 
neogenesis2004's Avatar
 
Join Date: 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.
neogenesis2004 is offline  
Old 06-11-2010, 02:56 PM
  #14  
Elite Member
iTrader: (7)
 
mgeoffriau's Avatar
 
Join Date: Jul 2009
Location: Jackson, MS
Posts: 7,388
Total Cats: 474
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.
mgeoffriau is offline  
Old 06-11-2010, 02:56 PM
  #15  
Elite Member
iTrader: (12)
 
neogenesis2004's Avatar
 
Join Date: Aug 2006
Posts: 4,413
Total Cats: 20
Default

well, I downloaded the source. Holy tons of files batman!
neogenesis2004 is offline  
Old 06-11-2010, 03:04 PM
  #16  
Elite Member
Thread Starter
iTrader: (10)
 
Jeff_Ciesielski's Avatar
 
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
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.
Jeff_Ciesielski is offline  
Old 06-11-2010, 03:11 PM
  #17  
Elite Member
iTrader: (30)
 
levnubhin's Avatar
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,329
Total Cats: 12
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
levnubhin is offline  
Old 06-11-2010, 03:14 PM
  #18  
Elite Member
iTrader: (12)
 
neogenesis2004's Avatar
 
Join Date: 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 :(
neogenesis2004 is offline  
Old 06-11-2010, 03:16 PM
  #19  
Elite Member
iTrader: (12)
 
neogenesis2004's Avatar
 
Join Date: 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.
neogenesis2004 is offline  
Old 06-11-2010, 03:19 PM
  #20  
Elite Member
iTrader: (12)
 
neogenesis2004's Avatar
 
Join Date: 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.
neogenesis2004 is offline  


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



All times are GMT -4. The time now is 03:00 AM.