software.scanner
Class DigitDeffinition

java.lang.Object
  extended by software.scanner.DigitDeffinition

public class DigitDeffinition
extends java.lang.Object

The geometry of every decimal digit (0-9) in the Tenacity Hr192 Bold font. A 1 represents a black pixel and a 0 a white one.

Author:
stefan

Constructor Summary
DigitDeffinition()
           
 
Method Summary
 int[][] allHamingDistances()
           
 byte[][] get(byte i)
           
 int getDigitHeight()
           
 int getDigitWidth()
           
 double getMaxDistance()
           
 double getMinDistance()
           
 int hammingDistance(byte[][] d1, byte[][] d2)
           
 int hammingDistance(int d1, int d2)
           
static void main(java.lang.String[] args)
           
 char minHammingDistance(byte[][] scannedDigit)
          Given a scanned digit, returns the digit that has the minimum hamming distance to one in the definition, if it is smaller then 0.35
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigitDeffinition

public DigitDeffinition()
Method Detail

get

public byte[][] get(byte i)

getDigitHeight

public int getDigitHeight()

getDigitWidth

public int getDigitWidth()

allHamingDistances

public int[][] allHamingDistances()
Returns:
the hamming distances between all the digit difinitions

hammingDistance

public int hammingDistance(byte[][] d1,
                           byte[][] d2)
Parameters:
d1 - between 0 and 9
d2 - between 0 and 9
Returns:
the hamming distance between two digits

minHammingDistance

public char minHammingDistance(byte[][] scannedDigit)
                        throws java.lang.Exception
Given a scanned digit, returns the digit that has the minimum hamming distance to one in the definition, if it is smaller then 0.35

Parameters:
scannedDigit -
Returns:
the digit that has the minimum hamming distance to one in the definition
Throws:
java.lang.Exception - - if the closest valid digit is futher away then 0.35

hammingDistance

public int hammingDistance(int d1,
                           int d2)
Parameters:
d1 - between 0 and 9
d2 - between 0 and 9
Returns:
the hamming distance between two digits

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getMaxDistance

public double getMaxDistance()

getMinDistance

public double getMinDistance()