Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   MEGAsquirt (https://www.miataturbo.net/megasquirt-18/)
-   -   Behold! My latest Project! (Map extractor from image files) (https://www.miataturbo.net/megasquirt-18/behold-my-latest-project-map-extractor-image-files-48431/)

Jeff_Ciesielski 06-11-2010 02:26 PM

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 fucking 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 :idea:

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:
http://boostedmiata.com/timing/nov-09.jpg


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:
http://lh4.ggpht.com/_tMYIeupe-9Q/TB...brainytest.JPG

The program goes through and whites out everything that isn't numeric, leaving you with this:
http://lh4.ggpht.com/_tMYIeupe-9Q/TB...Hwjg/strip.gif

(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:
http://lh6.ggpht.com/_tMYIeupe-9Q/TB...0/results1.JPG


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.

SKMetalworks 06-11-2010 02:29 PM

You know, while your at work, your suppose to be working not jacking off on some personal program.

wayne_curr 06-11-2010 02:31 PM

I dont know, all I read was

NerdNerd Nerd Nerdnerdnerdnerd Nerdiness and i'm a nerd.

J/k, very creative lol.

Braineack 06-11-2010 02:31 PM

or you ask someone to export their timing table and you simply import it?

Jeff_Ciesielski 06-11-2010 02:31 PM


Originally Posted by SKMetalworks (Post 587152)
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 06-11-2010 02:33 PM


Originally Posted by Braineack (Post 587155)
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 :giggle:

mgeoffriau 06-11-2010 02:36 PM

Apple and Macromedia and Google all just sued you.

Braineack 06-11-2010 02:38 PM


Originally Posted by mgeoffriau (Post 587158)
Apple and Macromedia and Google all just sued you.


OCR is nothing new. I bet Adobe Acrobat could get the text for you.

neogenesis2004 06-11-2010 02:39 PM

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.

Jeff_Ciesielski 06-11-2010 02:42 PM


Originally Posted by mgeoffriau (Post 587158)
Apple and Macromedia and Google all just sued you.

I'll be releasing the Iphone App later this year ;)

Jeff_Ciesielski 06-11-2010 02:43 PM


Originally Posted by neogenesis2004 (Post 587160)
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/

18psi 06-11-2010 02:46 PM

I dunno wtf you're talking about but I think I like it

neogenesis2004 06-11-2010 02:53 PM


Originally Posted by Jeff_Ciesielski (Post 587164)
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.

mgeoffriau 06-11-2010 02:56 PM


Originally Posted by Jeff_Ciesielski (Post 587162)
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.

neogenesis2004 06-11-2010 02:56 PM

well, I downloaded the source. Holy tons of files batman!

Jeff_Ciesielski 06-11-2010 03:04 PM


Originally Posted by neogenesis2004 (Post 587175)
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.

levnubhin 06-11-2010 03:11 PM

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

neogenesis2004 06-11-2010 03:14 PM

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 06-11-2010 03:16 PM


Originally Posted by levnubhin (Post 587183)
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 06-11-2010 03:19 PM

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 03:06 PM.


© 2024 MH Sub I, LLC dba Internet Brands