Behold! My latest Project! (Map extractor from image files) - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


MEGAsquirt A place to collectively sort out this megasquirt gizmo

Reply
 
 
 
LinkBack Thread Tools
Old 06-11-2010, 03:26 PM   #1
Elite Member
Thread Starter
iTrader: (10)
 
Join Date: Oct 2008
Location: Seattle, Wa
Posts: 1,780
Total Cats: 30
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   Reply With Quote
Old 06-11-2010, 03:29 PM   #2
Elite Member
iTrader: (7)
 
Join Date: Jan 2007
Location: Renton Washington
Posts: 1,742
Total Cats: 3
Default

You know, while your at work, your suppose to be working not jacking off on some personal program.
SKMetalworks is offline   Reply With Quote
Old 06-11-2010, 03:31 PM   #3
Elite Member
iTrader: (8)
 
Join Date: Aug 2007
Location: Bellingham, Wa
Posts: 2,732
Total Cats: 3
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   Reply With Quote
Old 06-11-2010, 03:31 PM   #4
Boost Czar
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,872
Total Cats: 1,790
Default

or you ask someone to export their timing table and you simply import it?
Braineack is offline   Reply With Quote
Old 06-11-2010, 03:31 PM   #5
Elite Member
Thread Starter
iTrader: (10)
 
Join Date: Oct 2008
Location: Seattle, Wa
Posts: 1,780
Total Cats: 30
Default

Quote:
Originally Posted by SKMetalworks View Post
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   Reply With Quote
Old 06-11-2010, 03:33 PM   #6
Elite Member
Thread Starter
iTrader: (10)
 
Join Date: Oct 2008
Location: Seattle, Wa
Posts: 1,780
Total Cats: 30
Default

Quote:
Originally Posted by Braineack View Post
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   Reply With Quote
Old 06-11-2010, 03:36 PM   #7
Crumple Zone Tester
iTrader: (7)
 
mgeoffriau's Avatar
 
Join Date: Jul 2009
Location: Jackson, MS
Posts: 7,656
Total Cats: 447
Default

Apple and Macromedia and Google all just sued you.
mgeoffriau is offline   Reply With Quote
Old 06-11-2010, 03:38 PM   #8
Boost Czar
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,872
Total Cats: 1,790
Default

Quote:
Originally Posted by mgeoffriau View Post
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   Reply With Quote
Old 06-11-2010, 03:39 PM   #9
Elite Member
iTrader: (12)
 
Join Date: Aug 2006
Location: Central-ish VA
Posts: 4,449
Total Cats: 16
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   Reply With Quote
Old 06-11-2010, 03:42 PM   #10
Elite Member
Thread Starter
iTrader: (10)
 
Join Date: Oct 2008
Location: Seattle, Wa
Posts: 1,780
Total Cats: 30
Default

Quote:
Originally Posted by mgeoffriau View Post
Apple and Macromedia and Google all just sued you.
I'll be releasing the Iphone App later this year
Jeff_Ciesielski is offline   Reply With Quote
Old 06-11-2010, 03:43 PM   #11
Elite Member
Thread Starter
iTrader: (10)
 
Join Date: Oct 2008
Location: Seattle, Wa
Posts: 1,780
Total Cats: 30
Default

Quote:
Originally Posted by neogenesis2004 View Post
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   Reply With Quote
Old 06-11-2010, 03:46 PM   #12
Murderator
iTrader: (76)
 
18psi's Avatar
 
Join Date: Apr 2008
Posts: 36,187
Total Cats: 2,583
Default

I dunno wtf you're talking about but I think I like it
18psi is offline   Reply With Quote
Old 06-11-2010, 03:53 PM   #13
Elite Member
iTrader: (12)
 
Join Date: Aug 2006
Location: Central-ish VA
Posts: 4,449
Total Cats: 16
Default

Quote:
Originally Posted by Jeff_Ciesielski View Post
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   Reply With Quote
Old 06-11-2010, 03:56 PM   #14
Crumple Zone Tester
iTrader: (7)
 
mgeoffriau's Avatar
 
Join Date: Jul 2009
Location: Jackson, MS
Posts: 7,656
Total Cats: 447
Default

Quote:
Originally Posted by Jeff_Ciesielski View Post
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   Reply With Quote
Old 06-11-2010, 03:56 PM   #15
Elite Member
iTrader: (12)
 
Join Date: Aug 2006
Location: Central-ish VA
Posts: 4,449
Total Cats: 16
Default

well, I downloaded the source. Holy tons of files batman!
neogenesis2004 is offline   Reply With Quote
Old 06-11-2010, 04:04 PM   #16
Elite Member
Thread Starter
iTrader: (10)
 
Join Date: Oct 2008
Location: Seattle, Wa
Posts: 1,780
Total Cats: 30
Default

Quote:
Originally Posted by neogenesis2004 View Post
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   Reply With Quote
Old 06-11-2010, 04:11 PM   #17
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
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   Reply With Quote
Old 06-11-2010, 04:14 PM   #18
Elite Member
iTrader: (12)
 
Join Date: Aug 2006
Location: Central-ish VA
Posts: 4,449
Total Cats: 16
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   Reply With Quote
Old 06-11-2010, 04:16 PM   #19
Elite Member
iTrader: (12)
 
Join Date: Aug 2006
Location: Central-ish VA
Posts: 4,449
Total Cats: 16
Default

Quote:
Originally Posted by levnubhin View Post
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   Reply With Quote
Old 06-11-2010, 04:19 PM   #20
Elite Member
iTrader: (12)
 
Join Date: Aug 2006
Location: Central-ish VA
Posts: 4,449
Total Cats: 16
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   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
Project Gemini - Turbo Civic on the Cheap Full_Tilt_Boogie Build Threads 58 12-13-2017 10:04 PM
LucaCarMods's Boosted Dutch Miata Build! LucaCarMods Build Threads 11 02-14-2016 07:13 AM
1991 special edition with hard top full part out JC, NJ russian Miata parts for sale/trade 6 10-08-2015 04:01 PM
"Chimney Ethanol" E100 MiataGarage Engine Performance 5 09-30-2015 12:04 AM
In need of base map for stock 1997 brandonbkd MEGAsquirt 0 09-29-2015 12:52 AM


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



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