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
7049ebba
Commit
7049ebba
authored
Sep 30, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ImProc ass3: Fuxed RGB color issue (?).
parent
0374d175
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
improc/ass3/intersect.py
improc/ass3/intersect.py
+8
-7
No files found.
improc/ass3/intersect.py
View file @
7049ebba
...
...
@@ -11,15 +11,15 @@ def domainIterator(image):
def
colHist
(
image
,
bins
,
model
):
h
=
zeros
(
tuple
(
bins
))
image
*=
list
(
bins
)
use
=
image
.
astype
(
float
)
*
bins
if
model
==
'rgb'
:
image
/=
255.
elif
model
==
'
rgba
'
:
use
/=
255
elif
model
==
'
hsv
'
:
pass
for
p
in
domainIterator
(
image
):
h
[
col2bin
(
imag
e
[
p
])]
+=
1
h
[
col2bin
(
us
e
[
p
])]
+=
1
return
h
...
...
@@ -28,6 +28,7 @@ def histogramIntersect(h1, h2):
raise
ValueError
(
'Shape mismatch between h1 and h2.'
)
match
=
0
#print h1, h2
for
r
in
xrange
(
h1
.
shape
[
0
]):
for
g
in
xrange
(
h1
.
shape
[
1
]):
...
...
@@ -39,12 +40,12 @@ def histogramIntersect(h1, h2):
# Create table of intersections
if
__name__
==
'__main__'
:
bins
=
[
8
]
*
3
db
=
map
(
lambda
x
:
imread
(
'database/%d.jpg'
%
x
),
range
(
1
,
3
))
db
=
map
(
lambda
x
:
imread
(
'database/%d.jpg'
%
x
),
range
(
1
,
21
))
table
=
zeros
((
len
(
db
),
len
(
db
)))
for
i
,
im
in
enumerate
(
db
):
for
j
in
xrange
(
i
+
1
,
len
(
db
)):
print
'comparing'
,
i
,
j
#
print 'comparing', i, j
table
[
i
,
j
]
=
histogramIntersect
(
colHist
(
im
,
bins
,
'rgb'
),
colHist
(
db
[
j
],
bins
,
'rgb'
))
...
...
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