Commit 064db9e0 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Improc ass3: Added debug info.

parent 072ae88c
......@@ -36,14 +36,20 @@ def histogramIntersect(h1, h2):
return match / h2.sum()
# Create table of intersections
bins = [8] * 3
db = map(lambda x: imread('database/%d.jpg' % x), range(1, 21))
table = zeros((len(db), len(db)))
enum = enumerate(db)
for i, im1 in enum:
for j, im2 in enum:
if __name__ == '__main':
bins = [8] * 3
print 'Reading images...'
db = map(lambda x: imread('database/%d.jpg' % x), range(1, 3))
print 'done'
table = zeros((len(db), len(db)))
for i, im1 in enumerate(db):
print i
for j, im2 in enumerate(db):
print j
if i != j:
print i, j
table[i, j] = histogramIntersect(colHist(im1, bins, 'rgb'),
colHist(im2, bins, 'rgb'))
print table
print table
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