Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pystencil_reco
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Seitz
pystencil_reco
Commits
312db1af
Commit
312db1af
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Add test_polar_transform
parent
4ee6a55b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_superresolution.py
+19
-1
19 additions, 1 deletion
tests/test_superresolution.py
with
19 additions
and
1 deletion
tests/test_superresolution.py
+
19
−
1
View file @
312db1af
...
@@ -11,9 +11,10 @@ from os.path import dirname, join
...
@@ -11,9 +11,10 @@ from os.path import dirname, join
import
numpy
as
np
import
numpy
as
np
import
skimage.io
import
skimage.io
import
sympy
import
pystencils
import
pystencils
from
pystencils_reco.resampling
import
downsample
,
scale_transform
,
translate
,
upsample
from
pystencils_reco.resampling
import
downsample
,
resample
,
scale_transform
,
translate
try
:
try
:
import
pyconrad.autoinit
import
pyconrad.autoinit
...
@@ -62,3 +63,20 @@ def test_warp():
...
@@ -62,3 +63,20 @@ def test_warp():
for
i
in
range
(
len
(
warped
)):
for
i
in
range
(
len
(
warped
)):
warp_kernel
(
lenna
[
i
],
warped
[
i
],
warp_vectors
[
i
])
warp_kernel
(
lenna
[
i
],
warped
[
i
],
warp_vectors
[
i
])
def
test_polar_transform
():
x
,
y
=
pystencils
.
fields
(
'
x, y: float32[2d]
'
)
x
.
set_coordinate_origin_to_field_center
()
y
.
set_coordinate_origin_to_field_center
()
y
.
coordinate_transform
=
lambda
x
:
sympy
.
Matrix
((
x
.
norm
(),
sympy
.
atan2
(
*
x
)
/
(
2
*
sympy
.
pi
)
*
y
.
shape
[
1
]))
lenna_file
=
join
(
dirname
(
__file__
),
"
test_data
"
,
"
lenna.png
"
)
lenna
=
skimage
.
io
.
imread
(
lenna_file
,
as_gray
=
True
).
astype
(
np
.
float32
)
transformed
=
np
.
zeros
((
500
,
500
),
np
.
float32
)
resample
(
x
,
y
).
compile
()(
x
=
lenna
,
y
=
transformed
)
pyconrad
.
imshow
(
transformed
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment