-
Notifications
You must be signed in to change notification settings - Fork 0
/
giant.camera_models.camera_model.html
290 lines (260 loc) · 22.5 KB
/
giant.camera_models.camera_model.html
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>giant.camera_models.camera_model — GIANT 1.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<link rel="icon" href="_static/logo.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="copyright" title="Copyright" href="copyright.html" />
<link rel="next" title="CameraModel" href="camera_model/giant.camera_models.camera_model.CameraModel.html" />
<link rel="prev" title="giant.camera_models" href="giant.camera_models.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo">
<a href="index.html">
<img class="logo" src="_static/logo.png" alt="Logo"/>
</a>
</p>
<p class="blurb">A powerful API for Optical Navigation</p>
<p>
<iframe src="https://ghbtns.com/github-btn.html?user=nasa&repo=giant&type=watch&count=true&size=large&v=2"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installing GIANT</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="giant.html">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="giant.html#indices">Indices</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="copyright.html">Copyright</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li><a href="giant.html">API Reference</a><ul>
<li><a href="giant.camera_models.html">giant.camera_models</a><ul>
<li>Previous: <a href="giant.camera_models.html" title="previous chapter">giant.camera_models</a></li>
<li>Next: <a href="camera_model/giant.camera_models.camera_model.CameraModel.html" title="next chapter">CameraModel</a></li>
</ul></li>
</ul></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
<nav id="rellinks">
<ul>
<li>
←
<a href="giant.camera_models.html" title="Previous document">giant.camera_models</a>
</li>
<li>
<a href="camera_model/giant.camera_models.camera_model.CameraModel.html" title="Next document">CameraModel</a>
→
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<section id="module-giant.camera_models.camera_model">
<span id="giant-camera-models-camera-model"></span><h1>giant.camera_models.camera_model<a class="headerlink" href="#module-giant.camera_models.camera_model" title="Permalink to this heading">¶</a></h1>
<p>This module provides an abstract base class (abc) for implementing GIANT camera models.</p>
<p>This abc provides a design guide for building GIANT compatible camera models. All user defined camera models should
probably subclass this class to ensure that they implement all of the required properties and methods that GIANT expects
a camera model to have <a class="footnote-reference brackets" href="#id2" id="id1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>. In addition, this module provides the functions <a class="reference internal" href="camera_model/giant.camera_models.camera_model.save.html#giant.camera_models.camera_model.save" title="giant.camera_models.camera_model.save"><code class="xref py py-func docutils literal notranslate"><span class="pre">save()</span></code></a> and <a class="reference internal" href="camera_model/giant.camera_models.camera_model.load.html#giant.camera_models.camera_model.load" title="giant.camera_models.camera_model.load"><code class="xref py py-func docutils literal notranslate"><span class="pre">load()</span></code></a> which can be
used to write/read camera models from disk in a human and machine readable format.</p>
<p>For a typical use case that doesn’t require a custom camera model, see the <a class="reference internal" href="pinhole_model/giant.camera_models.pinhole_model.PinholeModel.html#giant.camera_models.pinhole_model.PinholeModel" title="giant.camera_models.pinhole_model.PinholeModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">PinholeModel</span></code></a>, <a class="reference internal" href="brown_model/giant.camera_models.brown_model.BrownModel.html#giant.camera_models.brown_model.BrownModel" title="giant.camera_models.brown_model.BrownModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">BrownModel</span></code></a>,
<a class="reference internal" href="owen_model/giant.camera_models.owen_model.OwenModel.html#giant.camera_models.owen_model.OwenModel" title="giant.camera_models.owen_model.OwenModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">OwenModel</span></code></a>, or <a class="reference internal" href="opencv_model/giant.camera_models.opencv_model.OpenCVModel.html#giant.camera_models.opencv_model.OpenCVModel" title="giant.camera_models.opencv_model.OpenCVModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">OpenCVModel</span></code></a> classes which provide some of the most common models used in optical
navigation. These also serve as examples of how to make a concrete implementation of the <a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.html#giant.camera_models.camera_model.CameraModel" title="giant.camera_models.camera_model.CameraModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">CameraModel</span></code></a> abc.</p>
<p class="rubric">Footnotes</p>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="id2" role="note">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id1">1</a><span class="fn-bracket">]</span></span>
<p>GIANT will not error if you do not subclass <a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.html#giant.camera_models.camera_model.CameraModel" title="giant.camera_models.camera_model.CameraModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">CameraModel</span></code></a>, but it will print warnings to the screen.</p>
</aside>
</aside>
<section id="use">
<h2>Use<a class="headerlink" href="#use" title="Permalink to this heading">¶</a></h2>
<p>To implement a fully functional custom camera model for GIANT, you must implement the following methods in addition to
subclassing the <a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.html#giant.camera_models.camera_model.CameraModel" title="giant.camera_models.camera_model.CameraModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">CameraModel</span></code></a> class.</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Method</p></th>
<th class="head"><p>Use</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.project_onto_image.html#giant.camera_models.camera_model.CameraModel.project_onto_image" title="giant.camera_models.camera_model.CameraModel.project_onto_image"><code class="xref py py-meth docutils literal notranslate"><span class="pre">project_onto_image()</span></code></a></p></td>
<td><p>projects a point from the camera frame onto the image</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.compute_jacobian.html#giant.camera_models.camera_model.CameraModel.compute_jacobian" title="giant.camera_models.camera_model.CameraModel.compute_jacobian"><code class="xref py py-meth docutils literal notranslate"><span class="pre">compute_jacobian()</span></code></a></p></td>
<td><p>returns the Jacobian matrix
<span class="math notranslate nohighlight">\(\partial\mathbf{x}_P/\partial\mathbf{c}\)</span>
where <span class="math notranslate nohighlight">\(\mathbf{c}\)</span> is a vector of camera model parameters (like
focal length, pixel pitch, distortion coefficients, etc) and
<span class="math notranslate nohighlight">\(\mathbf{x}_P\)</span> is a pixel location.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.compute_pixel_jacobian.html#giant.camera_models.camera_model.CameraModel.compute_pixel_jacobian" title="giant.camera_models.camera_model.CameraModel.compute_pixel_jacobian"><code class="xref py py-meth docutils literal notranslate"><span class="pre">compute_pixel_jacobian()</span></code></a></p></td>
<td><p>returns the Jacobian matrix partialmathbf{x}_P/partialmathbf{x}_C`
where <span class="math notranslate nohighlight">\(\mathbf{x}_C\)</span> is a vector in the camera frame that
projects to <span class="math notranslate nohighlight">\(\mathbf{x}_P\)</span> which is the pixel location.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.compute_unit_vector_jacobian.html#giant.camera_models.camera_model.CameraModel.compute_unit_vector_jacobian" title="giant.camera_models.camera_model.CameraModel.compute_unit_vector_jacobian"><code class="xref py py-meth docutils literal notranslate"><span class="pre">compute_unit_vector_jacobian()</span></code></a></p></td>
<td><p>returns the Jacobian matrix partialmathbf{x}_C/partialmathbf{x}_P`
where <span class="math notranslate nohighlight">\(\mathbf{x}_C\)</span> is a unit vector in the camera frame that
projects to <span class="math notranslate nohighlight">\(\mathbf{x}_P\)</span> which is the pixel location.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.apply_update.html#giant.camera_models.camera_model.CameraModel.apply_update" title="giant.camera_models.camera_model.CameraModel.apply_update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">apply_update()</span></code></a></p></td>
<td><p>updates the camera model based on a vector of delta camera model
parameters</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.pixels_to_unit.html#giant.camera_models.camera_model.CameraModel.pixels_to_unit" title="giant.camera_models.camera_model.CameraModel.pixels_to_unit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pixels_to_unit()</span></code></a></p></td>
<td><p>transforms pixel coordinates into unit vectors in the camera frame</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.undistort_pixels.html#giant.camera_models.camera_model.CameraModel.undistort_pixels" title="giant.camera_models.camera_model.CameraModel.undistort_pixels"><code class="xref py py-meth docutils literal notranslate"><span class="pre">undistort_pixels()</span></code></a></p></td>
<td><p>takes a distorted pixel location and computes the corresponding
undistorted gnomic location in units of pixels</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.distort_pixels.html#giant.camera_models.camera_model.CameraModel.distort_pixels" title="giant.camera_models.camera_model.CameraModel.distort_pixels"><code class="xref py py-meth docutils literal notranslate"><span class="pre">distort_pixels()</span></code></a></p></td>
<td><p>applies the distortion model to gnomic points with units of pixels</p></td>
</tr>
</tbody>
</table>
<p>In addition the following methods and attributes are already implemented for most cases but may need to be overridden
for some special cases</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Method/Attribute</p></th>
<th class="head"><p>Use</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.overwrite.html#giant.camera_models.camera_model.CameraModel.overwrite" title="giant.camera_models.camera_model.CameraModel.overwrite"><code class="xref py py-meth docutils literal notranslate"><span class="pre">overwrite()</span></code></a></p></td>
<td><p>overwrites the calling instance with the attributes of another
instance in place</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.distortion_map.html#giant.camera_models.camera_model.CameraModel.distortion_map" title="giant.camera_models.camera_model.CameraModel.distortion_map"><code class="xref py py-meth docutils literal notranslate"><span class="pre">distortion_map()</span></code></a></p></td>
<td><p>generates a set of pixel coordinates+distortion values that can be
used to create a distortion quiver or contour map.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.undistort_image.html#giant.camera_models.camera_model.CameraModel.undistort_image" title="giant.camera_models.camera_model.CameraModel.undistort_image"><code class="xref py py-meth docutils literal notranslate"><span class="pre">undistort_image()</span></code></a></p></td>
<td><p>undistorts an entire image based on the distortion model (returns a
warped image)</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.copy.html#giant.camera_models.camera_model.CameraModel.copy" title="giant.camera_models.camera_model.CameraModel.copy"><code class="xref py py-meth docutils literal notranslate"><span class="pre">copy()</span></code></a></p></td>
<td><p>returns a copy of the current model</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.to_elem.html#giant.camera_models.camera_model.CameraModel.to_elem" title="giant.camera_models.camera_model.CameraModel.to_elem"><code class="xref py py-meth docutils literal notranslate"><span class="pre">to_elem()</span></code></a></p></td>
<td><p>a method that stores the model parameters in an element tree element
for saving the model to file</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.from_elem.html#giant.camera_models.camera_model.CameraModel.from_elem" title="giant.camera_models.camera_model.CameraModel.from_elem"><code class="xref py py-meth docutils literal notranslate"><span class="pre">from_elem()</span></code></a></p></td>
<td><p>a class method that retrieves the model parameters from an element
tree element for loading a model from a file</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.html#giant.camera_models.camera_model.CameraModel.n_rows" title="giant.camera_models.camera_model.CameraModel.n_rows"><code class="xref py py-attr docutils literal notranslate"><span class="pre">n_rows</span></code></a></p></td>
<td><p>The number of rows in pixels in an image captured by the device
modeled by this camera model</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.html#giant.camera_models.camera_model.CameraModel.n_cols" title="giant.camera_models.camera_model.CameraModel.n_cols"><code class="xref py py-attr docutils literal notranslate"><span class="pre">n_cols</span></code></a></p></td>
<td><p>The number of columns in pixels in an image captured by the device
modeled by this camera model</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.html#giant.camera_models.camera_model.CameraModel.field_of_view" title="giant.camera_models.camera_model.CameraModel.field_of_view"><code class="xref py py-attr docutils literal notranslate"><span class="pre">field_of_view</span></code></a></p></td>
<td><p>Half the diagonal field of view of the detector in units of degrees.</p></td>
</tr>
</tbody>
</table>
<p>Finally, if the <a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.to_elem.html#giant.camera_models.camera_model.CameraModel.to_elem" title="giant.camera_models.camera_model.CameraModel.to_elem"><code class="xref py py-meth docutils literal notranslate"><span class="pre">to_elem()</span></code></a> and <a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.from_elem.html#giant.camera_models.camera_model.CameraModel.from_elem" title="giant.camera_models.camera_model.CameraModel.from_elem"><code class="xref py py-meth docutils literal notranslate"><span class="pre">from_elem()</span></code></a> methods are not being overridden, the
<a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.html#giant.camera_models.camera_model.CameraModel.important_attributes" title="giant.camera_models.camera_model.CameraModel.important_attributes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">important_attributes</span></code></a> attribute should be extended with a list of attributes that must be
saved/loaded to completely reconstruct the camera model.</p>
</section>
<p class="rubric">Classes</p>
<table class="autosummary longtable docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.ReturnShape.html#giant.camera_models.camera_model.ReturnShape" title="giant.camera_models.camera_model.ReturnShape"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ReturnShape</span></code></a></p></td>
<td><p>This enumeration is used to specify what should be returned from method <a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.undistort_image.html#giant.camera_models.camera_model.CameraModel.undistort_image" title="giant.camera_models.camera_model.CameraModel.undistort_image"><code class="xref py py-meth docutils literal notranslate"><span class="pre">undistort_image()</span></code></a>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.CameraModel.html#giant.camera_models.camera_model.CameraModel" title="giant.camera_models.camera_model.CameraModel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">CameraModel</span></code></a></p></td>
<td><p>This is the abstract base class for all camera models in GIANT.</p></td>
</tr>
</tbody>
</table>
<p class="rubric">Functions</p>
<table class="autosummary longtable docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.save.html#giant.camera_models.camera_model.save" title="giant.camera_models.camera_model.save"><code class="xref py py-obj docutils literal notranslate"><span class="pre">save</span></code></a></p></td>
<td><p>This function is used to save a camera model to a GIANT xml file.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="camera_model/giant.camera_models.camera_model.load.html#giant.camera_models.camera_model.load" title="giant.camera_models.camera_model.load"><code class="xref py py-obj docutils literal notranslate"><span class="pre">load</span></code></a></p></td>
<td><p>This function is used to retrieve a camera model from a GIANT xml file.</p></td>
</tr>
</tbody>
</table>
<div class="toctree-wrapper compound">
</div>
</section>
</div>
<div class="related bottom">
<nav id="rellinks">
<ul>
<li>
←
<a href="giant.camera_models.html" title="Previous document">giant.camera_models</a>
</li>
<li>
<a href="camera_model/giant.camera_models.camera_model.CameraModel.html" title="Next document">CameraModel</a>
→
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2023 United States Government |
NASA Official: <a href="mailto:[email protected]">Andrew Liounis</a> |
Curator: <a href="mailto:[email protected]">Andrew Liounis</a>
<br>
Last updated on Mar 08, 2023 |
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>
|
<a href="_sources/giant.camera_models.camera_model.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>