Commit cbbcc441 authored by Taddeus Kroes's avatar Taddeus Kroes

Removed some unused imports.

parent bd4097f0
#!/usr/bin/python #!/usr/bin/python
from cPickle import dump, load from cPickle import load
from sys import argv, exit from sys import argv, exit
from pylab import imsave from pylab import imsave
import os import os
......
#!/usr/bin/python #!/usr/bin/python
from cPickle import dump, load from cPickle import load
from sys import argv, exit from sys import argv, exit
from Classifier import Classifier from Classifier import Classifier
......
#!/usr/bin/python #!/usr/bin/python
from matplotlib.pyplot import imshow, subplot, show from matplotlib.pyplot import imshow, subplot, show
from LocalBinaryPatternizer import LocalBinaryPatternizer from LocalBinaryPatternizer import LocalBinaryPatternizer
from GrayscaleImage import GrayscaleImage
from cPickle import load from cPickle import load
from numpy import zeros, resize from numpy import zeros
chars = load(file('characters.dat', 'r'))[::2] chars = load(file('characters.dat', 'r'))[::2]
left = None left = None
......
#!/usr/bin/python #!/usr/bin/python
from os import listdir from os import listdir
from cPickle import load
from sys import argv, exit from sys import argv, exit
from time import time from time import time
......
from os import mkdir from os import mkdir
from os.path import exists from os.path import exists
from math import acos from pylab import array, zeros, inv, dot, svd, floor
from pylab import imsave, array, zeros, inv, dot, norm, svd, floor
from xml.dom.minidom import parse from xml.dom.minidom import parse
from Point import Point from Point import Point
from Character import Character from Character import Character
...@@ -110,7 +109,7 @@ def xml_to_LicensePlate(filename, save_character=None): ...@@ -110,7 +109,7 @@ def xml_to_LicensePlate(filename, save_character=None):
character_image = NormalizedCharacterImage(data=character_data) character_image = NormalizedCharacterImage(data=character_data)
result_characters.append(Character(value, corners, character_image, filename)) result_characters.append(Character(value, corners, character_image, filename))
if save_character: if save_character:
single_character = GrayscaleImage(data=character_data) single_character = GrayscaleImage(data=character_data)
...@@ -133,26 +132,26 @@ def get_corners(dom): ...@@ -133,26 +132,26 @@ def get_corners(dom):
margin_x = 2 margin_x = 2
corners.append( corners.append(
Point(get_coord(nodes[0], "x") - margin_x, Point(get_coord(nodes[0], "x") - margin_x,
get_coord(nodes[0], "y") - margin_y) get_coord(nodes[0], "y") - margin_y)
) )
corners.append( corners.append(
Point(get_coord(nodes[1], "x") + margin_x, Point(get_coord(nodes[1], "x") + margin_x,
get_coord(nodes[1], "y") - margin_y) get_coord(nodes[1], "y") - margin_y)
) )
corners.append( corners.append(
Point(get_coord(nodes[2], "x") + margin_x, Point(get_coord(nodes[2], "x") + margin_x,
get_coord(nodes[2], "y") + margin_y) get_coord(nodes[2], "y") + margin_y)
) )
corners.append( corners.append(
Point(get_coord(nodes[3], "x") - margin_x, Point(get_coord(nodes[3], "x") - margin_x,
get_coord(nodes[3], "y") + margin_y) get_coord(nodes[3], "y") + margin_y)
) )
return corners return corners
def get_coord(node, attribute): def get_coord(node, attribute):
return int(node.getAttribute(attribute)) return int(node.getAttribute(attribute))
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment