Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
licenseplates
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Taddeüs Kroes
licenseplates
Commits
6061a74d
Commit
6061a74d
authored
13 years ago
by
Jayke Meijer
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused libraries from GaussianFilter.py
parent
1f4813bb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GaussianFilter.py
+0
-1
0 additions, 1 deletion
src/GaussianFilter.py
src/LicensePlate.py
+65
-2
65 additions, 2 deletions
src/LicensePlate.py
with
65 additions
and
3 deletions
src/GaussianFilter.py
+
0
−
1
View file @
6061a74d
from
GrayscaleImage
import
GrayscaleImage
from
scipy.ndimage
import
gaussian_filter
from
pylab
import
ceil
,
zeros
,
pi
,
exp
,
sqrt
,
array
class
GaussianFilter
:
...
...
This diff is collapsed.
Click to expand it.
src/LicensePlate.py
+
65
−
2
View file @
6061a74d
...
...
@@ -18,7 +18,70 @@ class LicensePlate:
self
.
height
=
int
(
properties
[
'
height
'
])
self
.
read_xml
()
def
corner_sorted
(
corners
):
'''
Check if points are sorted clockwise, starting in the left-top
corner.
'''
x0
,
y0
=
corners
[
0
].
to_tuple
()
x1
,
y1
=
corners
[
1
].
to_tuple
()
x2
,
y2
=
corners
[
2
].
to_tuple
()
x3
,
y3
=
corners
[
3
].
to_tuple
()
return
x0
<
x1
and
y1
<
y2
and
x2
>
x3
and
y3
>
y0
def
sort_corners
(
corners
):
'''
Sort the corners clockwise, starting in the left-top corner.
'''
tuples
=
[]
output
=
[]
for
point
in
corners
:
tuples
.
append
(
point
.
to_tuple
())
bot1
=
(
0
,
0
)
bot2
=
(
0
,
0
)
top1
=
None
top2
=
None
# Get bottom points (where the y value is the largest). The top points
# are the points that are not a bottom point.
for
tup
in
tuples
:
if
tup
[
1
]
>
bot1
[
1
]
or
tup
[
1
]
>
bot2
[
1
]:
if
top1
==
None
:
top1
=
bot2
else
:
top2
=
bot2
if
tup
[
1
]
>
bot1
[
1
]:
bot2
=
bot1
bot1
=
tup
else
:
bot2
=
tup
else
:
if
top1
==
None
:
top1
=
tup
else
:
top2
=
tup
# First point is the smallest x-value top point, second is the other
# top point
if
top1
[
0
]
<
top2
[
0
]:
output
.
append
(
Point
(
top1
[
0
],
top1
[
1
]))
output
.
append
(
Point
(
top2
[
0
],
top2
[
1
]))
else
:
output
.
append
(
Point
(
top2
[
0
],
top2
[
1
]))
output
.
append
(
Point
(
top1
[
0
],
top1
[
1
]))
# Third point is the bottom point with the largest x-value, fourth is
# the other bottom point
if
bot1
[
0
]
>
bot2
[
0
]:
output
.
append
(
Point
(
bot1
[
0
],
bot1
[
1
]))
output
.
append
(
Point
(
bot2
[
0
],
bot2
[
1
]))
else
:
output
.
append
(
Point
(
bot2
[
0
],
bot2
[
1
]))
output
.
append
(
Point
(
bot1
[
0
],
bot1
[
1
]))
return
output
# sets the entire license plate of an image
def
retrieve_data
(
self
,
corners
):
x0
,
y0
=
corners
[
0
].
to_tuple
()
...
...
@@ -154,4 +217,4 @@ class LicensePlate:
if
corner
.
nodeName
==
"
point
"
:
corners
.
append
(
Point
(
corner
))
return
corners
\ No newline at end of file
return
corners
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment