Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SemiSmoothNewton.jl
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Hilb
SemiSmoothNewton.jl
Commits
ef4e839a
Commit
ef4e839a
authored
Dec 6, 2021
by
Stephan Hilb
Browse files
Options
Downloads
Patches
Plain Diff
add preliminary image mesh interpolation tests
parent
59cdd730
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/run_experiments.jl
+44
-0
44 additions, 0 deletions
scripts/run_experiments.jl
with
44 additions
and
0 deletions
scripts/run_experiments.jl
+
44
−
0
View file @
ef4e839a
...
...
@@ -959,3 +959,47 @@ function experiment_optflow_middlebury(ctx)
ctx
=
Util
.
Context
(
ctx
;
imgf0
,
imgf1
)
return
optflow
(
ctx
)
end
function
test_image
(
n
=
2
^
6
;
supersample_factor
=
16
)
q
=
supersample_factor
imgs
=
zeros
(
n
,
n
)
f
((
a
,
b
))
=
(
sin
(
0.5
*
6
/
(
a
^
2
+
b
^
2
+
1e-1
))
+
1
)
/
2
for
I
in
CartesianIndices
((
n
,
n
))
for
J
in
CartesianIndices
((
q
,
q
))
imgs
[
I
]
+=
f
((
Tuple
(
I
*
q
-
J
)
.+
0.5
)
./
(
n
*
q
))
end
imgs
[
I
]
/=
q
^
2
end
return
imgs
end
function
experiment_image_mesh_interpolation
(
ctx
)
imgf
=
loadimg
(
joinpath
(
ctx
.
indir
,
"input.png"
))
# TODO: test other meshes
mesh
=
init_grid
(
imgf
)
space
=
FeSpace
(
mesh
,
P1
(),
(
1
,))
u
=
FeFunction
(
space
)
# all methods use bilinear interpolation for image evaluations
methods
=
[
#"nodal_interpolation" => interpolate!,
## techniques that use lagrange-lattice quadratures
"l2_projection"
=>
project_img!
,
#"clement" => projec_clement!,
"l1_stable_quasi_interpolation"
=>
project_img2!
,
#"l1_stable_quasi_interpolation_avg" => project_img2!,
#"l2_regression" => project_img_regression!,
]
map
(
methods
)
do
(
name
,
f
)
u
=
FeFunction
(
space
)
f
(
u
,
imgf
)
save_csv
(
joinpath
(
ctx
.
outdir
,
name
*
".csv"
),
u
)
end
end
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