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
86da37b2
Commit
86da37b2
authored
Oct 21, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improc ass4: Prettified 3d plot.
parent
00f34f99
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
improc/ass4/gauss.py
improc/ass4/gauss.py
+7
-4
No files found.
improc/ass4/gauss.py
View file @
86da37b2
...
@@ -56,11 +56,14 @@ def Gauss1(s, order=0):
...
@@ -56,11 +56,14 @@ def Gauss1(s, order=0):
# Make sure that the sum of all kernel values is equal to one
# Make sure that the sum of all kernel values is equal to one
return
W
/
W
.
sum
()
return
W
/
W
.
sum
()
def
plot_mask
(
W
,
ax
,
stride
):
def
plot_mask
(
W
,
ax
):
""""""
""""""
x
=
arange
(
W
.
shape
[
0
])
x
=
arange
(
W
.
shape
[
0
])
Y
,
X
=
meshgrid
(
x
,
x
)
Y
,
X
=
meshgrid
(
x
,
x
)
ax
.
plot_surface
(
X
,
Y
,
W
,
rstride
=
stride
,
cstride
=
stride
,
cmap
=
'jet'
)
#stride = s / 4
#ax.plot_surface(X, Y, W, rstride=stride, cstride=stride, cmap='jet')
ax
.
plot_surface
(
X
,
Y
,
W
,
rstride
=
1
,
cstride
=
1
,
linewidth
=
0
,
\
antialiased
=
True
,
cmap
=
'jet'
)
ax
.
set_xlabel
(
'x'
)
ax
.
set_xlabel
(
'x'
)
ax
.
set_ylabel
(
'y'
)
ax
.
set_ylabel
(
'y'
)
ax
.
set_zlabel
(
'g(x, y)'
)
ax
.
set_zlabel
(
'g(x, y)'
)
...
@@ -100,7 +103,7 @@ if __name__ == '__main__':
...
@@ -100,7 +103,7 @@ if __name__ == '__main__':
W
,
G
=
gD
(
F
,
s
,
int
(
argv
[
3
]),
int
(
argv
[
4
]))
W
,
G
=
gD
(
F
,
s
,
int
(
argv
[
3
]),
int
(
argv
[
4
]))
subplot
(
131
)
subplot
(
131
)
imshow
(
F
,
cmap
=
'gray'
)
imshow
(
F
,
cmap
=
'gray'
)
plot_mask
(
W
,
subplot
(
132
,
projection
=
'3d'
)
,
s
/
4
)
plot_mask
(
W
,
subplot
(
132
,
projection
=
'3d'
))
subplot
(
133
)
subplot
(
133
)
imshow
(
G
,
cmap
=
'gray'
)
imshow
(
G
,
cmap
=
'gray'
)
elif
argv
[
1
]
==
'timer'
:
elif
argv
[
1
]
==
'timer'
:
...
@@ -147,7 +150,7 @@ if __name__ == '__main__':
...
@@ -147,7 +150,7 @@ if __name__ == '__main__':
imshow
(
F
,
cmap
=
'gray'
)
imshow
(
F
,
cmap
=
'gray'
)
# Gauss function (3D plot)
# Gauss function (3D plot)
plot_mask
(
W
,
subplot
(
132
,
projection
=
'3d'
)
,
s
/
4
)
plot_mask
(
W
,
subplot
(
132
,
projection
=
'3d'
))
# Convolution
# Convolution
subplot
(
133
)
subplot
(
133
)
...
...
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