Moose |
Don't make me assume my ultimate form!
|
|
|
Reged: 05/03/04
|
Posts: 1483
|
Loc: Outback, Australia
|
|
Send PM
|
|
|
Attached is a ZIP containing my Java source code that analyses an image and automatically works out the 1/0 for each region. Also includes 2 images (screen shots from siprOn).
NOTES: * The "average brightness of the top 50 pixels in a region" seemed to work better than the "average brightness of all pixels in a region". But I have left the code for both averages in so anyone can explore further. * This code works for included screen shots (see "Sample Output" below). * For other screen shots to work, you will probably need to adjust the size, offsets, etc below. * The threshold value - oneZeroThresholdValue - will almost certainly need adjusting for different images / scans. * Lots of improvements could easily be added (let me know if I can help). e.g. a nice GUI interface, drag and drop, image parameter sensing (where the red lines are, etc), and so on.
Sample Output:
instructions_03.png 10011011 00011110 11101101 00001001 11110110 11001100 10111111 11110110
== 100% correct !
instructions_04_enlarge - one bit in the image is dirty.png 11100010 11101101 11110000 01111111 11111010 11100111 11100001 11010111
== 100% correct !
If you can make use of this Java code, great. Otherwise, no worries.
100% Freeware - any person, any company, etc can use/adapt freely. (If you want to give me credit, great, but not mandatory).
Update: new version attached - it processes both files - to need to comment/uncomment 2 lines and re-run, tidy up some code, output more information for each image.
Moose
Edited by Moose (07/27/17 11:15 AM)
|
|