Skip to content
Snippets Groups Projects
Commit 34726b7b authored by Fabien's avatar Fabien
Browse files

commentaar weg

parent fa706a98
No related branches found
No related tags found
No related merge requests found
...@@ -5,12 +5,6 @@ from Character import Character ...@@ -5,12 +5,6 @@ from Character import Character
from GrayscaleImage import GrayscaleImage from GrayscaleImage import GrayscaleImage
from NormalizedCharacterImage import NormalizedCharacterImage from NormalizedCharacterImage import NormalizedCharacterImage
"""
Creates a license plate object based on an XML file. The image should be
placed in a folder 'images' the xml file in a folder 'xml'
TODO: perhaps remove non required XML lookups
"""
class LicensePlate: class LicensePlate:
def __init__(self, folder_nr, file_nr): def __init__(self, folder_nr, file_nr):
...@@ -52,7 +46,9 @@ class LicensePlate: ...@@ -52,7 +46,9 @@ class LicensePlate:
for i in range(0, M): for i in range(0, M):
for j in range(0, N): for j in range(0, N):
or_coor = dot(P, ([[i],[j],[1]])) or_coor = dot(P, ([[i],[j],[1]]))
or_coor_h = or_coor[1][0] / or_coor[2][0], or_coor[0][0] / or_coor[2][0] or_coor_h = or_coor[1][0] / or_coor[2][0],
or_coor[0][0] / or_coor[2][0]
data[j][i] = self.pV(or_coor_h[0], or_coor_h[1]) data[j][i] = self.pV(or_coor_h[0], or_coor_h[1])
return data return data
...@@ -74,9 +70,7 @@ class LicensePlate: ...@@ -74,9 +70,7 @@ class LicensePlate:
def pV(self, x, y): def pV(self, x, y):
image = self.image image = self.image
'''Get the value of a point x,y in the given image, where x and y are not #Get the value of a point (interpolated x, y) in the given image
necessary integers, so the value is interpolated from its neighbouring
pixels.'''
if image.in_bounds(x, y): if image.in_bounds(x, y):
x_low = floor(x) x_low = floor(x)
x_high = floor(x + 1) x_high = floor(x + 1)
...@@ -160,4 +154,4 @@ class LicensePlate: ...@@ -160,4 +154,4 @@ class LicensePlate:
if corner.nodeName == "point": if corner.nodeName == "point":
corners.append(Point(corner)) corners.append(Point(corner))
return corners return corners
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment