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
8ab571b3
Commit
8ab571b3
authored
Oct 11, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improc ass4: Fixed integer/float problem.
parent
8c79a839
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
improc/ass4/gauss.py
improc/ass4/gauss.py
+5
-5
improc/ass4/report/gauss_diff.pdf
improc/ass4/report/gauss_diff.pdf
+0
-0
No files found.
improc/ass4/gauss.py
View file @
8ab571b3
...
@@ -15,9 +15,9 @@ def exit_with_usage():
...
@@ -15,9 +15,9 @@ def exit_with_usage():
def
Gauss
(
s
):
def
Gauss
(
s
):
"""Create a sampled Gaussian function of scale s."""
"""Create a sampled Gaussian function of scale s."""
size
=
int
(
ceil
(
3
*
s
))
size
=
int
(
ceil
(
3
*
s
))
r
=
2
*
int
(
ceil
(
3
*
s
))
+
1
r
=
2
*
size
+
1
W
=
zeros
((
r
,
r
))
W
=
zeros
((
r
,
r
))
t
=
s
**
2
t
=
s
**
2
.
a
=
1
/
(
2
*
pi
*
t
)
a
=
1
/
(
2
*
pi
*
t
)
# Sample the Gaussian function
# Sample the Gaussian function
...
@@ -59,7 +59,7 @@ elif argv[1] == 'diff':
...
@@ -59,7 +59,7 @@ elif argv[1] == 'diff':
if
len
(
argv
)
<
3
:
if
len
(
argv
)
<
3
:
exit_with_usage
()
exit_with_usage
()
s
=
in
t
(
argv
[
2
])
s
=
floa
t
(
argv
[
2
])
W
=
Gauss
(
s
)
W
=
Gauss
(
s
)
G
=
convolve
(
F
,
W
,
mode
=
'nearest'
)
G
=
convolve
(
F
,
W
,
mode
=
'nearest'
)
...
@@ -67,11 +67,11 @@ elif argv[1] == 'diff':
...
@@ -67,11 +67,11 @@ elif argv[1] == 'diff':
subplot
(
131
)
subplot
(
131
)
imshow
(
F
,
cmap
=
'gray'
)
imshow
(
F
,
cmap
=
'gray'
)
# Gauss function
# Gauss function
(3D plot)
x
=
arange
(
W
.
shape
[
0
])
x
=
arange
(
W
.
shape
[
0
])
X
,
Y
=
meshgrid
(
x
,
x
)
X
,
Y
=
meshgrid
(
x
,
x
)
ax
=
subplot
(
132
,
projection
=
'3d'
)
ax
=
subplot
(
132
,
projection
=
'3d'
)
stride
=
s
/
3
stride
=
s
/
4
ax
.
plot_surface
(
X
,
Y
,
W
,
rstride
=
stride
,
cstride
=
stride
,
cmap
=
'jet'
)
ax
.
plot_surface
(
X
,
Y
,
W
,
rstride
=
stride
,
cstride
=
stride
,
cmap
=
'jet'
)
ax
.
set_xlabel
(
'x'
)
ax
.
set_xlabel
(
'x'
)
ax
.
set_ylabel
(
'y'
)
ax
.
set_ylabel
(
'y'
)
...
...
improc/ass4/report/gauss_diff.pdf
View file @
8ab571b3
No preview for this file type
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