-
Notifications
You must be signed in to change notification settings - Fork 1
/
DeblurringTest.nb
87 lines (81 loc) · 2.8 KB
/
DeblurringTest.nb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 11.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 2622, 79]
NotebookOptionsPosition[ 2376, 66]
NotebookOutlinePosition[ 2724, 81]
CellTagsIndexPosition[ 2681, 78]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"psfMotion", "[",
RowBox[{
RowBox[{"dim_", "?", "NumberQ"}], ",", " ",
RowBox[{"theta_", "?", "NumberQ"}]}], "]"}], " ", ":=", "\n",
RowBox[{"Module", "[",
RowBox[{
RowBox[{"{", "PSF", "}"}], ",", "\n",
RowBox[{
RowBox[{"PSF", " ", "=", " ",
RowBox[{"ConstantArray", "[",
RowBox[{"0.0", ",", " ",
RowBox[{"{",
RowBox[{"dim", ",", " ", "dim"}], "}"}]}], "]"}]}], ";", "\n",
RowBox[{
RowBox[{"PSF", "[",
RowBox[{"[",
RowBox[{
RowBox[{"Ceiling", "[",
RowBox[{"dim", " ", "/", " ", "2.0"}], "]"}], ",", " ", "All"}],
"]"}], "]"}], " ", "=", " ",
RowBox[{"1.0", " ", "/", " ", "dim"}]}], ";", "\n",
RowBox[{"Return", "[",
RowBox[{"ImageRotate", "[",
RowBox[{
RowBox[{"Image", "[", "PSF", "]"}], ",", " ",
RowBox[{"theta", " ", "Degree"}]}], "]"}], "]"}], ";"}]}], "\n",
"]"}]}], ";"}], "\n",
RowBox[{
RowBox[{"psf", " ", "=", " ",
RowBox[{"psfMotion", "[",
RowBox[{"22", ",", " ",
RowBox[{"-", "2"}]}], "]"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{"Image", "[", "psf", "]"}], "\[IndentingNewLine]",
RowBox[{"ImageDeconvolve", "[",
RowBox[{"img", ",", " ", "psf", ",", " ",
RowBox[{"Method", " ", "->", " ", "\"\<Wiener\>\""}], ",", " ", "\n",
RowBox[{"MaxIterations", " ", "->", " ", "10"}]}], "]"}]}], "Input",
CellChangeTimes->{{3.7323691792934184`*^9, 3.732369234437172*^9}, {
3.7323693194630346`*^9, 3.732369356925419*^9}, {3.7323701314623604`*^9,
3.7323702079505806`*^9}, {3.7345451199033947`*^9, 3.734545129621933*^9}, {
3.7375601695438185`*^9, 3.7375601712539015`*^9}, {3.737561167495435*^9,
3.7375611699659653`*^9}}]
},
WindowSize->{759, 833},
WindowMargins->{{Automatic, 326}, {36, Automatic}},
FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (September 21, 2016)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 1814, 44, 202, "Input"]
}
]
*)