Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
064db9e0
Commit
064db9e0
authored
Sep 30, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improc ass3: Added debug info.
parent
072ae88c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
improc/ass3/intersect.py
improc/ass3/intersect.py
+17
-11
No files found.
improc/ass3/intersect.py
View file @
064db9e0
...
@@ -36,14 +36,20 @@ def histogramIntersect(h1, h2):
...
@@ -36,14 +36,20 @@ def histogramIntersect(h1, h2):
return
match
/
h2
.
sum
()
return
match
/
h2
.
sum
()
# Create table of intersections
# Create table of intersections
bins
=
[
8
]
*
3
if
__name__
==
'__main'
:
db
=
map
(
lambda
x
:
imread
(
'database/%d.jpg'
%
x
),
range
(
1
,
21
))
bins
=
[
8
]
*
3
table
=
zeros
((
len
(
db
),
len
(
db
)))
print
'Reading images...'
enum
=
enumerate
(
db
)
db
=
map
(
lambda
x
:
imread
(
'database/%d.jpg'
%
x
),
range
(
1
,
3
))
print
'done'
for
i
,
im1
in
enum
:
table
=
zeros
((
len
(
db
),
len
(
db
)))
for
j
,
im2
in
enum
:
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'
),
table
[
i
,
j
]
=
histogramIntersect
(
colHist
(
im1
,
bins
,
'rgb'
),
colHist
(
im2
,
bins
,
'rgb'
))
colHist
(
im2
,
bins
,
'rgb'
))
print
table
print
table
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment