diff --git a/doc/build/doctrees/database.doctree b/doc/build/doctrees/database.doctree index 17516021a0059dcb9281a9bee0d191c8abf9cbe4..2d5588f798d4b181bb70cb3efb2b38e659b5fa66 100644 Binary files a/doc/build/doctrees/database.doctree and b/doc/build/doctrees/database.doctree differ diff --git a/doc/build/doctrees/environment.pickle b/doc/build/doctrees/environment.pickle index 19be6e17d80895c1df6a85473b3c0c834c539756..798f3106d459b45a5ea102260b966c8f1fda588b 100644 Binary files a/doc/build/doctrees/environment.pickle and b/doc/build/doctrees/environment.pickle differ diff --git a/doc/build/doctrees/processing.doctree b/doc/build/doctrees/processing.doctree index d19e2e5f19a57734a79ccf99bc48cfbbef8ccfd0..fed56b00c83183510c133a9ba8f541fb57da153b 100644 Binary files a/doc/build/doctrees/processing.doctree and b/doc/build/doctrees/processing.doctree differ diff --git a/doc/build/html/_images/contrast_weighted_nearness.png b/doc/build/html/_images/contrast_weighted_nearness.png index a6d1cd369048813c39b8bde88647132fa5365fd4..0e8b0237f2b46694bdc5c08c6c85e890f381221a 100644 Binary files a/doc/build/html/_images/contrast_weighted_nearness.png and b/doc/build/html/_images/contrast_weighted_nearness.png differ diff --git a/doc/build/html/_images/michelson_contrast.png b/doc/build/html/_images/michelson_contrast.png index 3232e009759e012641c7768d9b8a692b617ed914..e8acf133dff78fc385fcd0a43ad7bf5d6d75a48c 100644 Binary files a/doc/build/html/_images/michelson_contrast.png and b/doc/build/html/_images/michelson_contrast.png differ diff --git a/doc/build/html/_modules/index.html b/doc/build/html/_modules/index.html index 7e95bef384488aac892ed3f4c209c35e5303eaa5..dadd2414fede3a3d086de990bcfda4a59d6cb332 100644 --- a/doc/build/html/_modules/index.html +++ b/doc/build/html/_modules/index.html @@ -40,10 +40,10 @@ <div class="body" role="main"> <h1>All modules for which code is available</h1> -<ul><li><a href="navipy/processing.html">navipy.processing</a></li> -<ul><li><a href="navipy/processing/mcode.html">navipy.processing.mcode</a></li> +<ul><li><a href="navipy/database.html">navipy.database</a></li> +<li><a href="navipy/processing/mcode.html">navipy.processing.mcode</a></li> <li><a href="navipy/processing/pcode.html">navipy.processing.pcode</a></li> -</ul></ul> +</ul> </div> </div> diff --git a/doc/build/html/_sources/database.rst.txt b/doc/build/html/_sources/database.rst.txt index 423ec399727a27112c7d98ccbb718b4719b7f90b..7b6604c0201529b50e0390e26f7fa9f3673a79bb 100644 --- a/doc/build/html/_sources/database.rst.txt +++ b/doc/build/html/_sources/database.rst.txt @@ -2,3 +2,6 @@ Database ======== .. automodule:: navipy.database + +.. autoclass:: navipy.database.DataBaseLoad + :members: diff --git a/doc/build/html/_sources/processing.rst.txt b/doc/build/html/_sources/processing.rst.txt index 40af2eb8917bcf95a03ed00d7c6d039b889ed92f..f637eefcbb62c8cd885d361dfa935cf0fd5e03b3 100644 --- a/doc/build/html/_sources/processing.rst.txt +++ b/doc/build/html/_sources/processing.rst.txt @@ -5,9 +5,6 @@ Processing a scene Place code ---------- -Scene -~~~~~ -.. autofunction:: navipy.processing.pcode.scene Skyline ~~~~~~~ diff --git a/doc/build/html/database.html b/doc/build/html/database.html index 20afe5f91250049fae03e198f95e382d7e66197b..1ef558fbe095b8b72249ad795d5b69af976e82c9 100644 --- a/doc/build/html/database.html +++ b/doc/build/html/database.html @@ -93,6 +93,64 @@ <img alt="_images/load_image_rowid.png" src="_images/load_image_rowid.png" /> </div> </div> +<dl class="class"> +<dt id="navipy.database.DataBaseLoad"> +<em class="property">class </em><code class="descclassname">navipy.database.</code><code class="descname">DataBaseLoad</code><span class="sig-paren">(</span><em>filename, channels=['R', 'G', 'B', 'D']</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.database.DataBaseLoad" title="Permalink to this definition">¶</a></dt> +<dd><p>A database generated by the rendering module is based on sqlite3.</p> +<dl class="attribute"> +<dt id="navipy.database.DataBaseLoad.create"> +<code class="descname">create</code><a class="headerlink" href="#navipy.database.DataBaseLoad.create" title="Permalink to this definition">¶</a></dt> +<dd><p>use to decide weather to alter the database or not +return False because we do not want +to write on database (Load class)</p> +</dd></dl> + +<dl class="method"> +<dt id="navipy.database.DataBaseLoad.iter_posorients"> +<code class="descname">iter_posorients</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#navipy.database.DataBaseLoad.iter_posorients" title="Permalink to this definition">¶</a></dt> +<dd><p>Iter through all position orientation in the database</p> +</dd></dl> + +<dl class="attribute"> +<dt id="navipy.database.DataBaseLoad.posorients"> +<code class="descname">posorients</code><a class="headerlink" href="#navipy.database.DataBaseLoad.posorients" title="Permalink to this definition">¶</a></dt> +<dd><p>Return the position orientations of all points in the database</p> +</dd></dl> + +<dl class="method"> +<dt id="navipy.database.DataBaseLoad.scene"> +<code class="descname">scene</code><span class="sig-paren">(</span><em>posorient=None</em>, <em>rowid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.database.DataBaseLoad.scene" title="Permalink to this definition">¶</a></dt> +<dd><p>Return a scene at a position orientation or given rowid in a given database.</p> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>database</strong> – a DataBaseLoad class :param posorient: a pandas Series with index: [‘x’,’y’,’z’,’alpha_0,’alpha_1,’alpha_2’] (default None, i.e. not used)</li> +<li><strong>rowid</strong> – a row identification integer for directly reading in the database (default None, i.e. not used).</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a scene [elevation, azimuth, channel, 1] or [ommatidia,channel,1].</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">np.ndarray</p> +</td> +</tr> +</tbody> +</table> +<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">my_scene</span> <span class="o">=</span> <span class="n">mydb</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> + +</pre></div> +</div> +<p>(<a class="reference external" href="./example/database/scene.py">Source code</a>, <a class="reference external" href="./example/database/scene.png">png</a>, <a class="reference external" href="./example/database/scene.hires.png">hires.png</a>, <a class="reference external" href="./example/database/scene.pdf">pdf</a>)</p> +<div class="figure"> +<img alt="_images/scene.png" src="_images/scene.png" /> +</div> +</dd></dl> + +</dd></dl> + </div> diff --git a/doc/build/html/example/processing/apcv.pdf b/doc/build/html/example/processing/apcv.pdf index 779e5f2d781bc53dd5bee8d14caf71af354b3ce4..cd1fa5291580f521accb3ce68b8bb9406d41ee5a 100644 Binary files a/doc/build/html/example/processing/apcv.pdf and b/doc/build/html/example/processing/apcv.pdf differ diff --git a/doc/build/html/example/processing/apcv.py b/doc/build/html/example/processing/apcv.py index 6a334a822022d8f2b6e5ecbb5aeb1eefa531d7fc..00a9c1727e4da1c174e952c5250c0e280e2154a5 100644 --- a/doc/build/html/example/processing/apcv.py +++ b/doc/build/html/example/processing/apcv.py @@ -11,7 +11,7 @@ mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.pcode.scene(mydb, rowid=rowid) +my_scene = mydb.scene(rowid=rowid) my_apcv = processing.pcode.apcv(my_scene, mydb.viewing_directions) my_apcv_sph = processing.tools.cartesian_to_spherical(x=my_apcv[..., 0], diff --git a/doc/build/html/example/processing/contrast_weighted_nearness.hires.png b/doc/build/html/example/processing/contrast_weighted_nearness.hires.png index 7f85ad02951f54406a8d2a16337b358866509500..2a106386c962f774891c24844664d1a1b5b23f24 100644 Binary files a/doc/build/html/example/processing/contrast_weighted_nearness.hires.png and b/doc/build/html/example/processing/contrast_weighted_nearness.hires.png differ diff --git a/doc/build/html/example/processing/contrast_weighted_nearness.pdf b/doc/build/html/example/processing/contrast_weighted_nearness.pdf index 457933fb189385d706c2a997a625ef0c7c08fa76..00a86f5a9286e1433eb97a6ccc3a76b3a392f329 100644 Binary files a/doc/build/html/example/processing/contrast_weighted_nearness.pdf and b/doc/build/html/example/processing/contrast_weighted_nearness.pdf differ diff --git a/doc/build/html/example/processing/contrast_weighted_nearness.png b/doc/build/html/example/processing/contrast_weighted_nearness.png index a6d1cd369048813c39b8bde88647132fa5365fd4..0e8b0237f2b46694bdc5c08c6c85e890f381221a 100644 Binary files a/doc/build/html/example/processing/contrast_weighted_nearness.png and b/doc/build/html/example/processing/contrast_weighted_nearness.png differ diff --git a/doc/build/html/example/processing/contrast_weighted_nearness.py b/doc/build/html/example/processing/contrast_weighted_nearness.py index 9704ff106bbf974840ad4ba8286fe778dfbee43f..220863a1abe332baafab7d0bc5c24c3f23b932cf 100644 --- a/doc/build/html/example/processing/contrast_weighted_nearness.py +++ b/doc/build/html/example/processing/contrast_weighted_nearness.py @@ -11,7 +11,7 @@ mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.pcode.scene(mydb, rowid=rowid) +my_scene = mydb.scene(rowid=rowid) my_contrast = processing.pcode.contrast_weighted_nearness(my_scene) f, axarr = plt.subplots(2, 2, figsize=(15, 8)) diff --git a/doc/build/html/example/processing/michelson_contrast.hires.png b/doc/build/html/example/processing/michelson_contrast.hires.png index 78c79be5f6e28e55d182c4789b7551e6f80ce3ee..f28e1fedbabca15ba1e4ccf745fce290eb68e552 100644 Binary files a/doc/build/html/example/processing/michelson_contrast.hires.png and b/doc/build/html/example/processing/michelson_contrast.hires.png differ diff --git a/doc/build/html/example/processing/michelson_contrast.pdf b/doc/build/html/example/processing/michelson_contrast.pdf index 4d975926c7e8bcb5d0de58b85661a5eee248941d..7998e4acb5ba331bd4aed8621c4e6b24640c80e1 100644 Binary files a/doc/build/html/example/processing/michelson_contrast.pdf and b/doc/build/html/example/processing/michelson_contrast.pdf differ diff --git a/doc/build/html/example/processing/michelson_contrast.png b/doc/build/html/example/processing/michelson_contrast.png index 3232e009759e012641c7768d9b8a692b617ed914..e8acf133dff78fc385fcd0a43ad7bf5d6d75a48c 100644 Binary files a/doc/build/html/example/processing/michelson_contrast.png and b/doc/build/html/example/processing/michelson_contrast.png differ diff --git a/doc/build/html/example/processing/michelson_contrast.py b/doc/build/html/example/processing/michelson_contrast.py index 4e05c76b55bd29e4cc60abeb65489cb724af5f6b..e7bb58c764eac18c265467c1d9046838c222d8d3 100644 --- a/doc/build/html/example/processing/michelson_contrast.py +++ b/doc/build/html/example/processing/michelson_contrast.py @@ -1,17 +1,18 @@ import matplotlib.pyplot as plt from navipy.database import DataBaseLoad import navipy.processing as processing -import os +import pkg_resources # 1) Connect to the database -mydb_filename = os.path.abspath('../database.db') +mydb_filename = pkg_resources.resource_filename( + 'navipy', 'resources/database.db') mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.scene(mydb, rowid=rowid) -my_contrast = processing.michelson_contrast(my_scene) +my_scene = mydb.scene(rowid=rowid) +my_contrast = processing.pcode.michelson_contrast(my_scene) f, axarr = plt.subplots(2, 2, figsize=(15, 8)) axarr = axarr.flatten() diff --git a/doc/build/html/example/processing/pcv.py b/doc/build/html/example/processing/pcv.py index d6251279ec3b0be4d1e3e7d0a3adfaa56eeb6ea0..6c2017ccb18e8489b38b03aa968051cf2816efd8 100644 --- a/doc/build/html/example/processing/pcv.py +++ b/doc/build/html/example/processing/pcv.py @@ -11,5 +11,5 @@ mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.pcode.scene(mydb, rowid=rowid) +my_scene = mydb.scene(rowid=rowid) my_pcv = processing.pcode.pcv(my_scene, mydb.viewing_directions) diff --git a/doc/build/html/example/processing/skyline.pdf b/doc/build/html/example/processing/skyline.pdf index 681f2274ae58c885764cbe638892e7bb71a1dd82..1061869f8ccbce3b20d4e7b65d959c91b5097c22 100644 Binary files a/doc/build/html/example/processing/skyline.pdf and b/doc/build/html/example/processing/skyline.pdf differ diff --git a/doc/build/html/example/processing/skyline.py b/doc/build/html/example/processing/skyline.py index 11ac0a7a19b91b485c046c6add0da1c89e7512fd..499bacb14a6b6f83fef09403fee3484646fd160d 100644 --- a/doc/build/html/example/processing/skyline.py +++ b/doc/build/html/example/processing/skyline.py @@ -1,17 +1,18 @@ import matplotlib.pyplot as plt from navipy.database import DataBaseLoad import navipy.processing as processing -import os +import pkg_resources # 1) Connect to the database -mydb_filename = os.path.abspath('../database.db') +mydb_filename = pkg_resources.resource_filename( + 'navipy', 'resources/database.db') mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.scene(mydb, rowid=rowid) -my_skyline = processing.skyline(my_scene) +my_scene = mydb.scene(rowid=rowid) +my_skyline = processing.pcode.skyline(my_scene) f, axarr = plt.subplots(1, 2, figsize=(15, 4)) for chan_i, chan_n in enumerate(mydb.channels): diff --git a/doc/build/html/genindex.html b/doc/build/html/genindex.html index 1f92beff8e898db0b263b75db638fac617b3b697..cfea0171ad00c5039d00fbd47ba2c0812be3a5ae 100644 --- a/doc/build/html/genindex.html +++ b/doc/build/html/genindex.html @@ -46,6 +46,8 @@ <div class="genindex-jumpbox"> <a href="#A"><strong>A</strong></a> | <a href="#C"><strong>C</strong></a> + | <a href="#D"><strong>D</strong></a> + | <a href="#I"><strong>I</strong></a> | <a href="#M"><strong>M</strong></a> | <a href="#N"><strong>N</strong></a> | <a href="#O"><strong>O</strong></a> @@ -65,6 +67,26 @@ <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="processing.html#navipy.processing.pcode.contrast_weighted_nearness">contrast_weighted_nearness() (in module navipy.processing.pcode)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="database.html#navipy.database.DataBaseLoad.create">create (navipy.database.DataBaseLoad attribute)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="D">D</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="database.html#navipy.database.DataBaseLoad">DataBaseLoad (class in navipy.database)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="I">I</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="database.html#navipy.database.DataBaseLoad.iter_posorients">iter_posorients() (navipy.database.DataBaseLoad method)</a> </li> </ul></td> </tr></table> @@ -101,6 +123,10 @@ <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> <li><a href="processing.html#navipy.processing.pcode.pcv">pcv() (in module navipy.processing.pcode)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="database.html#navipy.database.DataBaseLoad.posorients">posorients (navipy.database.DataBaseLoad attribute)</a> </li> </ul></td> </tr></table> @@ -108,7 +134,7 @@ <h2 id="S">S</h2> <table style="width: 100%" class="indextable genindextable"><tr> <td style="width: 33%; vertical-align: top;"><ul> - <li><a href="processing.html#navipy.processing.pcode.scene">scene() (in module navipy.processing.pcode)</a> + <li><a href="database.html#navipy.database.DataBaseLoad.scene">scene() (navipy.database.DataBaseLoad method)</a> </li> </ul></td> <td style="width: 33%; vertical-align: top;"><ul> diff --git a/doc/build/html/objects.inv b/doc/build/html/objects.inv index afada50bab01ee33c439414e131a9333d8e1bfa2..3367409cd86a5b85cd03adf395600693b1a77b55 100644 Binary files a/doc/build/html/objects.inv and b/doc/build/html/objects.inv differ diff --git a/doc/build/html/processing.html b/doc/build/html/processing.html index 88294b074272245435051d45bde89a4ee702cd3d..926c068b9cfcce9b603a56f730cde6a603bfa762 100644 --- a/doc/build/html/processing.html +++ b/doc/build/html/processing.html @@ -83,41 +83,6 @@ In that case the scene is a 3d numpy array Therefore ibs and obs have 4 and 3 dimension, respectively.</p> <div class="section" id="place-code"> <h2>Place code<a class="headerlink" href="#place-code" title="Permalink to this headline">¶</a></h2> -<div class="section" id="scene"> -<h3>Scene<a class="headerlink" href="#scene" title="Permalink to this headline">¶</a></h3> -<dl class="function"> -<dt id="navipy.processing.pcode.scene"> -<code class="descclassname">navipy.processing.pcode.</code><code class="descname">scene</code><span class="sig-paren">(</span><em>database</em>, <em>posorient=None</em>, <em>rowid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#navipy.processing.pcode.scene" title="Permalink to this definition">¶</a></dt> -<dd><p>Return a scene at a position orientation or given rowid in a given database.</p> -<table class="docutils field-list" frame="void" rules="none"> -<col class="field-name" /> -<col class="field-body" /> -<tbody valign="top"> -<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> -<li><strong>database</strong> – a DataBaseLoad class :param posorient: a pandas Series with index: [‘x’,’y’,’z’,’alpha_0,’alpha_1,’alpha_2’] (default None, i.e. not used)</li> -<li><strong>rowid</strong> – a row identification integer for directly reading in the database (default None, i.e. not used).</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a scene [elevation, azimuth, channel, 1] or [ommatidia,channel,1].</p> -</td> -</tr> -<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">np.ndarray</p> -</td> -</tr> -</tbody> -</table> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span> -<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> -</pre></div> -</div> -<p>(<a class="reference external" href="./example/processing/scene.py">Source code</a>, <a class="reference external" href="./example/processing/scene.png">png</a>, <a class="reference external" href="./example/processing/scene.hires.png">hires.png</a>, <a class="reference external" href="./example/processing/scene.pdf">pdf</a>)</p> -<div class="figure"> -<img alt="_images/scene.png" src="_images/scene.png" /> -</div> -</dd></dl> - -</div> <div class="section" id="skyline"> <h3>Skyline<a class="headerlink" href="#skyline" title="Permalink to this headline">¶</a></h3> <dl class="function"> @@ -127,9 +92,9 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p> :param scene: the scenery at a given location (a 4d numpy array) :returns: the skyline [1,azimuth,channel,1] :rtype: np.ndarray</p> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span> -<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> -<span class="n">my_skyline</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">skyline</span><span class="p">(</span><span class="n">my_scene</span><span class="p">)</span> +<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># we want the image</span> +<span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span> +<span class="n">my_scene</span> <span class="o">=</span> <span class="n">mydb</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> </pre></div> </div> <p>(<a class="reference external" href="./example/processing/skyline.py">Source code</a>, <a class="reference external" href="./example/processing/skyline.png">png</a>, <a class="reference external" href="./example/processing/skyline.hires.png">hires.png</a>, <a class="reference external" href="./example/processing/skyline.pdf">pdf</a>)</p> @@ -166,9 +131,9 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p> </tr> </tbody> </table> -<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span> -<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> -<span class="n">my_contrast</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">michelson_contrast</span><span class="p">(</span><span class="n">my_scene</span><span class="p">)</span> +<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># we want the image</span> +<span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span> +<span class="n">my_scene</span> <span class="o">=</span> <span class="n">mydb</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> </pre></div> </div> <p>(<a class="reference external" href="./example/processing/michelson_contrast.py">Source code</a>, <a class="reference external" href="./example/processing/michelson_contrast.png">png</a>, <a class="reference external" href="./example/processing/michelson_contrast.hires.png">hires.png</a>, <a class="reference external" href="./example/processing/michelson_contrast.pdf">pdf</a>)</p> @@ -198,7 +163,7 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p> </tbody> </table> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span> -<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> +<span class="n">my_scene</span> <span class="o">=</span> <span class="n">mydb</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> <span class="n">my_contrast</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">contrast_weighted_nearness</span><span class="p">(</span><span class="n">my_scene</span><span class="p">)</span> </pre></div> </div> @@ -234,7 +199,7 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p> </tbody> </table> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span> -<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> +<span class="n">my_scene</span> <span class="o">=</span> <span class="n">mydb</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> <span class="n">my_pcv</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">pcv</span><span class="p">(</span><span class="n">my_scene</span><span class="p">,</span> <span class="n">mydb</span><span class="o">.</span><span class="n">viewing_directions</span><span class="p">)</span> </pre></div> </div> @@ -267,7 +232,7 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p> </tbody> </table> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rowid</span> <span class="o">=</span> <span class="mi">12</span> -<span class="n">my_scene</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">mydb</span><span class="p">,</span> <span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> +<span class="n">my_scene</span> <span class="o">=</span> <span class="n">mydb</span><span class="o">.</span><span class="n">scene</span><span class="p">(</span><span class="n">rowid</span><span class="o">=</span><span class="n">rowid</span><span class="p">)</span> <span class="n">my_apcv</span> <span class="o">=</span> <span class="n">processing</span><span class="o">.</span><span class="n">pcode</span><span class="o">.</span><span class="n">apcv</span><span class="p">(</span><span class="n">my_scene</span><span class="p">,</span> <span class="n">mydb</span><span class="o">.</span><span class="n">viewing_directions</span><span class="p">)</span> </pre></div> </div> @@ -303,7 +268,6 @@ Therefore ibs and obs have 4 and 3 dimension, respectively.</p> <ul> <li><a class="reference internal" href="#">Processing a scene</a><ul> <li><a class="reference internal" href="#place-code">Place code</a><ul> -<li><a class="reference internal" href="#scene">Scene</a></li> <li><a class="reference internal" href="#skyline">Skyline</a></li> <li><a class="reference internal" href="#michelson-contrast">Michelson-contrast</a></li> <li><a class="reference internal" href="#contrast-weighted-nearness">Contrast-weighted-nearness</a></li> diff --git a/doc/build/html/searchindex.js b/doc/build/html/searchindex.js index 010f43cc62b1ce39c23cf304a9713d49de97e540..df5fede7980f998ea42102c653ab71d3140fd9e6 100644 --- a/doc/build/html/searchindex.js +++ b/doc/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["analysing","comparing","computing","database","gettingstarted","index","moving","processing","rendering"],envversion:53,filenames:["analysing.rst","comparing.rst","computing.rst","database.rst","gettingstarted.rst","index.rst","moving.rst","processing.rst","rendering.rst"],objects:{"navipy.processing.mcode":{optic_flow:[7,1,1,""]},"navipy.processing.pcode":{apcv:[7,1,1,""],contrast_weighted_nearness:[7,1,1,""],michelson_contrast:[7,1,1,""],pcv:[7,1,1,""],scene:[7,1,1,""],skyline:[7,1,1,""]},navipy:{database:[3,0,0,"-"],processing:[7,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"case":[3,7],"class":7,"default":7,"final":8,"import":[3,8],"return":[3,7],IBS:7,NOT:[],OBS:7,The:[3,7],With:8,__file__:8,about:1,abspath:[],abus:7,access:3,activ:8,activate_thi:8,activate_virtualenv:8,all:8,along:7,alpha1:8,alpha2:8,alpha3:8,alpha_0:[3,7],alpha_1:[3,7,8],alpha_2:[3,7,8],alpha_3:8,alreadi:3,alwai:7,analys:5,apcv:7,around:7,arrai:[7,8],astyp:[],axarr:[],azimuth:7,background:8,base:7,basten:7,bee:3,bee_samp:8,bee_sampl:8,been:3,beesampl:8,bin:8,blend:8,calcul:[3,7],can:[3,7,8],care:[],cartesian:7,certain:3,channel:[3,7],classic:7,code:3,come:8,compar:5,compon:7,compress:8,comput:5,configur:8,connect:[],consist:3,constant:3,constrast:7,contain:3,contrast_s:7,contrast_weighted_near:7,coordin:7,correspond:3,cost:3,creat:[],create_sampling_grid:8,databas:[5,7],databaseload:[3,7],def:8,defin:7,demo_test:8,depend:3,deriv:7,describ:3,dict:8,differ:3,dimens:7,direct:7,directli:7,disposit:8,distanc:[7,8],distance_channel:7,e402:8,each:[3,7],either:7,elev:7,els:8,entir:3,env:8,environment_nam:8,equal:8,equirectangular:7,ever:3,exampl:[],exec:8,expandus:8,extens:7,eye:7,figsiz:[],filepath:8,folder:8,follow:7,from:[3,7,8],full:3,gener:3,get:5,get_posori:3,given:[3,7,8],grid:8,grow:[],has:3,have:7,head:3,here:8,highest:7,hire:[3,7],home:8,howev:3,ibpc:7,ibs:7,identif:7,identifi:3,imag:[6,7,8],implement:[],imshow:[],inde:3,index:[3,5,7],infin:8,insect:7,instal:8,instead:3,integ:7,intens:7,interpol:6,introduc:8,invert_yaxi:[],its:8,join:8,just:8,know:3,line:[],linspac:8,list:[],literalinclud:[],local:7,locat:7,look:3,lowest:7,lumin:7,mai:3,mallot:7,manner:7,map:7,matplotlib:[],max:[],maximum:[7,8],mcode:7,memori:1,mesh:[],method:7,michelson_contrast:7,min:[],minimum:7,modul:[3,5,8],more:3,move:5,my_apcv:7,my_contrast:7,my_pcv:7,my_scen:7,my_skylin:7,mydb:[3,7],mydb_filenam:3,name:8,navig:[3,8],navipi:[7,8],ndarrai:7,need:[7,8],neighbour:6,none:7,noqa:8,normalis:3,now:8,number:[3,7],numpi:[7,8],object:8,obpc:7,obs:7,omatidium:7,ommatidia:7,ommatidium:7,open:8,optic_flow:7,orient:7,orientaiton:3,orinet:[],otherwis:8,our:8,own:8,page:5,panda:7,panoram:7,param:7,paramet:7,part:7,path:8,pcode:7,pcv:7,pdf:[3,7],pixel:7,place_cod:7,plot:[],plt:[],png:[3,7],point:[],posit:7,position_orient:3,posori:[3,7],process:[3,5],project:7,provid:3,pyplot:[],python:8,quickli:[],rang:3,read:[7,8],read_imag:3,region:7,regular:7,render:[3,5],repres:7,respect:7,row:[3,7],rowid:[3,7],rtype:7,scene:5,sceneri:7,search:5,sens:7,seri:[3,7],show:[],sinc:8,situat:3,size:7,sourc:[3,7],space:7,speak:3,speed:3,sqrt:8,start:5,strategi:3,subplot:[],tabl:3,talk:1,technic:3,tell:8,tempfil:8,temporarydirectori:8,terminolog:7,therefor:7,thi:3,three:[],through:3,thu:[3,7,8],time:3,to_plot_dist:[],to_plot_im:[],toolbox:[7,8],transform:7,type:7,uint8:[],uniqu:3,until:8,use:[3,8],used:[3,7,8],useful:3,variabl:8,veloc:7,view:7,viewing_direct:7,virtualenv:8,want:8,were:3,what:8,wheight:7,when:7,where:[3,8],which:3,workon_hom:8,world_dim:8,zero:8},titles:["Analysing","Comparing","Computing","Database","Getting started","Welcome to Navigation Toolbox\u2019s documentation!","Moving","Processing a scene","Rendering"],titleterms:{agent:0,all:3,analys:0,area:0,around:0,attractor:0,averag:[2,7],between:6,blender:8,build:8,catchment:0,code:[2,7],compar:1,comput:2,contrast:7,cyberbe:8,databas:[3,8],differ:[1,2],document:5,doe:0,environ:8,familiar:[1,2],few:0,find:0,flow:7,from:2,gener:8,get:4,goal:0,grid:6,home:0,how:[3,8],idf:1,imag:[1,2,3],indic:5,infomax:1,load:3,michelson:7,motion:7,move:6,navig:5,nearness:7,network:[1,2],optic:7,orient:3,place:[2,7],point:6,posit:3,process:7,regular:8,render:8,ridf:1,rotat:[1,2],sampl:8,scene:7,script:8,skylin:7,start:4,tabl:5,test:8,toolbox:5,type:0,using:8,vector:[2,7],weight:7,welcom:5,your:8}}) \ No newline at end of file +Search.setIndex({docnames:["analysing","comparing","computing","database","gettingstarted","index","moving","processing","rendering"],envversion:53,filenames:["analysing.rst","comparing.rst","computing.rst","database.rst","gettingstarted.rst","index.rst","moving.rst","processing.rst","rendering.rst"],objects:{"navipy.database":{DataBaseLoad:[3,1,1,""]},"navipy.database.DataBaseLoad":{create:[3,2,1,""],iter_posorients:[3,3,1,""],posorients:[3,2,1,""],scene:[3,3,1,""]},"navipy.processing.mcode":{optic_flow:[7,4,1,""]},"navipy.processing.pcode":{apcv:[7,4,1,""],contrast_weighted_nearness:[7,4,1,""],michelson_contrast:[7,4,1,""],pcv:[7,4,1,""],skyline:[7,4,1,""]},navipy:{database:[3,0,0,"-"],processing:[7,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","attribute","Python attribute"],"3":["py","method","Python method"],"4":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:attribute","3":"py:method","4":"py:function"},terms:{"case":[3,7],"class":3,"default":3,"final":8,"import":[3,8],"return":[3,7],IBS:7,NOT:[],OBS:7,The:[3,7],With:8,__file__:8,about:1,abspath:[],abus:7,access:3,activ:8,activate_thi:8,activate_virtualenv:8,all:8,along:7,alpha1:8,alpha2:8,alpha3:8,alpha_0:3,alpha_1:[3,8],alpha_2:[3,8],alpha_3:8,alreadi:3,alter:3,alwai:7,analys:5,apcv:7,around:7,arrai:[7,8],astyp:[],axarr:[],azimuth:[3,7],background:8,base:[3,7],basten:7,becaus:3,bee:3,bee_samp:8,bee_sampl:8,been:3,beesampl:8,bin:8,blend:8,calcul:[3,7],can:[3,7,8],care:[],cartesian:7,certain:3,channel:[3,7],classic:7,code:3,come:8,compar:5,compon:7,compress:8,comput:5,configur:8,connect:[],consist:3,constant:3,constrast:7,contain:3,contrast_s:7,contrast_weighted_near:7,coordin:7,correspond:3,cost:3,creat:3,create_sampling_grid:8,databas:5,databaseload:3,decid:3,def:8,defin:7,demo_test:8,depend:3,deriv:7,describ:3,dict:8,differ:3,dimens:7,direct:7,directli:3,disposit:8,distanc:[7,8],distance_channel:7,e402:8,each:[3,7],either:7,elev:[3,7],els:8,entir:3,env:8,environment_nam:8,equal:8,equirectangular:7,ever:3,exampl:[],exec:8,expandus:8,extens:7,eye:7,fals:3,figsiz:[],filenam:3,filepath:8,folder:8,follow:7,from:[3,7,8],full:3,gener:3,get:5,get_posori:3,given:[3,7,8],grid:8,grow:[],has:3,have:7,head:3,here:8,highest:7,hire:[3,7],home:8,howev:3,ibpc:7,ibs:7,identif:3,identifi:3,imag:[6,7,8],implement:[],imshow:[],inde:3,index:[3,5,7],infin:8,insect:7,instal:8,instead:3,integ:3,intens:7,interpol:6,introduc:8,invert_yaxi:[],iter:3,iter_posori:3,its:8,join:8,just:8,know:3,line:[],linspac:8,list:[],literalinclud:[],local:7,locat:7,look:3,lowest:7,lumin:7,mai:3,mallot:7,manner:7,map:7,matplotlib:[],max:[],maximum:[7,8],mcode:7,member:[],memori:1,mesh:[],method:7,michelson_contrast:7,min:[],minimum:7,modul:[3,5,8],more:3,move:5,my_apcv:7,my_contrast:7,my_pcv:7,my_scen:[3,7],my_skylin:[],mydb:[3,7],mydb_filenam:3,name:8,navig:[3,8],navipi:[3,7,8],ndarrai:[3,7],need:[7,8],neighbour:6,none:3,noqa:8,normalis:3,now:8,number:[3,7],numpi:[7,8],object:8,obpc:7,obs:7,omatidium:7,ommatidia:[3,7],ommatidium:7,open:8,optic_flow:7,orient:[],orientaiton:3,orinet:[],otherwis:8,our:8,own:8,page:5,panda:3,panoram:7,param:[3,7],paramet:[3,7],part:7,path:8,pcode:7,pcv:7,pdf:[3,7],pixel:7,place_cod:7,plot:[],plt:[],png:[3,7],point:3,posit:[],position_orient:3,posori:3,process:[3,5],project:7,provid:3,pyplot:[],python:8,quickli:[],rang:3,read:[3,8],read_imag:3,region:7,regular:7,render:[3,5],repres:7,respect:7,row:3,rowid:[3,7],rtype:7,scene:[3,5],sceneri:7,search:5,sens:7,seri:3,show:[],sinc:8,situat:3,size:7,sourc:[3,7],space:7,speak:3,speed:3,sqlite3:3,sqrt:8,start:5,strategi:3,subplot:[],tabl:3,talk:1,technic:3,tell:8,tempfil:8,temporarydirectori:8,terminolog:7,therefor:7,thi:3,three:[],through:3,thu:[3,7,8],time:3,to_plot_dist:[],to_plot_im:[],toolbox:[7,8],transform:7,type:[3,7],uint8:[],uniqu:3,until:8,use:[3,8],used:[3,7,8],useful:3,variabl:8,veloc:7,view:7,viewing_direct:7,virtualenv:8,want:[3,7,8],weather:3,were:3,what:8,wheight:7,when:7,where:[3,8],which:3,workon_hom:8,world_dim:8,write:3,zero:8},titles:["Analysing","Comparing","Computing","Database","Getting started","Welcome to Navigation Toolbox\u2019s documentation!","Moving","Processing a scene","Rendering"],titleterms:{agent:0,all:3,analys:0,area:0,around:0,attractor:0,averag:[2,7],between:6,blender:8,build:8,catchment:0,code:[2,7],compar:1,comput:2,contrast:7,cyberbe:8,databas:[3,8],differ:[1,2],document:5,doe:0,environ:8,familiar:[1,2],few:0,find:0,flow:7,from:2,gener:8,get:4,goal:0,grid:6,home:0,how:[3,8],idf:1,imag:[1,2,3],indic:5,infomax:1,load:3,michelson:7,motion:7,move:6,navig:5,nearness:7,network:[1,2],optic:7,orient:3,place:[2,7],point:6,posit:3,process:7,regular:8,render:8,ridf:1,rotat:[1,2],sampl:8,scene:7,script:8,skylin:7,start:4,tabl:5,test:8,toolbox:5,type:0,using:8,vector:[2,7],weight:7,welcom:5,your:8}}) \ No newline at end of file diff --git a/doc/build/plot_directive/example/processing/apcv.pdf b/doc/build/plot_directive/example/processing/apcv.pdf index 779e5f2d781bc53dd5bee8d14caf71af354b3ce4..cd1fa5291580f521accb3ce68b8bb9406d41ee5a 100644 Binary files a/doc/build/plot_directive/example/processing/apcv.pdf and b/doc/build/plot_directive/example/processing/apcv.pdf differ diff --git a/doc/build/plot_directive/example/processing/contrast_weighted_nearness.hires.png b/doc/build/plot_directive/example/processing/contrast_weighted_nearness.hires.png index 7f85ad02951f54406a8d2a16337b358866509500..2a106386c962f774891c24844664d1a1b5b23f24 100644 Binary files a/doc/build/plot_directive/example/processing/contrast_weighted_nearness.hires.png and b/doc/build/plot_directive/example/processing/contrast_weighted_nearness.hires.png differ diff --git a/doc/build/plot_directive/example/processing/contrast_weighted_nearness.pdf b/doc/build/plot_directive/example/processing/contrast_weighted_nearness.pdf index 457933fb189385d706c2a997a625ef0c7c08fa76..00a86f5a9286e1433eb97a6ccc3a76b3a392f329 100644 Binary files a/doc/build/plot_directive/example/processing/contrast_weighted_nearness.pdf and b/doc/build/plot_directive/example/processing/contrast_weighted_nearness.pdf differ diff --git a/doc/build/plot_directive/example/processing/contrast_weighted_nearness.png b/doc/build/plot_directive/example/processing/contrast_weighted_nearness.png index a6d1cd369048813c39b8bde88647132fa5365fd4..0e8b0237f2b46694bdc5c08c6c85e890f381221a 100644 Binary files a/doc/build/plot_directive/example/processing/contrast_weighted_nearness.png and b/doc/build/plot_directive/example/processing/contrast_weighted_nearness.png differ diff --git a/doc/build/plot_directive/example/processing/michelson_contrast.hires.png b/doc/build/plot_directive/example/processing/michelson_contrast.hires.png index 78c79be5f6e28e55d182c4789b7551e6f80ce3ee..f28e1fedbabca15ba1e4ccf745fce290eb68e552 100644 Binary files a/doc/build/plot_directive/example/processing/michelson_contrast.hires.png and b/doc/build/plot_directive/example/processing/michelson_contrast.hires.png differ diff --git a/doc/build/plot_directive/example/processing/michelson_contrast.pdf b/doc/build/plot_directive/example/processing/michelson_contrast.pdf index 4d975926c7e8bcb5d0de58b85661a5eee248941d..7998e4acb5ba331bd4aed8621c4e6b24640c80e1 100644 Binary files a/doc/build/plot_directive/example/processing/michelson_contrast.pdf and b/doc/build/plot_directive/example/processing/michelson_contrast.pdf differ diff --git a/doc/build/plot_directive/example/processing/michelson_contrast.png b/doc/build/plot_directive/example/processing/michelson_contrast.png index 3232e009759e012641c7768d9b8a692b617ed914..e8acf133dff78fc385fcd0a43ad7bf5d6d75a48c 100644 Binary files a/doc/build/plot_directive/example/processing/michelson_contrast.png and b/doc/build/plot_directive/example/processing/michelson_contrast.png differ diff --git a/doc/build/plot_directive/example/processing/skyline.pdf b/doc/build/plot_directive/example/processing/skyline.pdf index 681f2274ae58c885764cbe638892e7bb71a1dd82..1061869f8ccbce3b20d4e7b65d959c91b5097c22 100644 Binary files a/doc/build/plot_directive/example/processing/skyline.pdf and b/doc/build/plot_directive/example/processing/skyline.pdf differ diff --git a/doc/source/database.rst b/doc/source/database.rst index 423ec399727a27112c7d98ccbb718b4719b7f90b..7b6604c0201529b50e0390e26f7fa9f3673a79bb 100644 --- a/doc/source/database.rst +++ b/doc/source/database.rst @@ -2,3 +2,6 @@ Database ======== .. automodule:: navipy.database + +.. autoclass:: navipy.database.DataBaseLoad + :members: diff --git a/doc/source/example/processing/scene.py b/doc/source/example/database/scene.py similarity index 88% rename from doc/source/example/processing/scene.py rename to doc/source/example/database/scene.py index 79c699e2c1502b8d338d789ad1d00fb47808391f..31d166e558addc0506de679c98b669b532a3f9c0 100644 --- a/doc/source/example/processing/scene.py +++ b/doc/source/example/database/scene.py @@ -1,7 +1,6 @@ import numpy as np import matplotlib.pyplot as plt from navipy.database import DataBaseLoad -import navipy.processing as processing import pkg_resources @@ -12,7 +11,7 @@ mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image and get the scene rowid = 12 -my_scene = processing.pcode.scene(mydb, rowid=rowid) +my_scene = mydb.scene(rowid=rowid) f, axarr = plt.subplots(1, 2, figsize=(15, 4)) diff --git a/doc/source/example/processing/apcv.py b/doc/source/example/processing/apcv.py index 6a334a822022d8f2b6e5ecbb5aeb1eefa531d7fc..00a9c1727e4da1c174e952c5250c0e280e2154a5 100644 --- a/doc/source/example/processing/apcv.py +++ b/doc/source/example/processing/apcv.py @@ -11,7 +11,7 @@ mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.pcode.scene(mydb, rowid=rowid) +my_scene = mydb.scene(rowid=rowid) my_apcv = processing.pcode.apcv(my_scene, mydb.viewing_directions) my_apcv_sph = processing.tools.cartesian_to_spherical(x=my_apcv[..., 0], diff --git a/doc/source/example/processing/contrast_weighted_nearness.py b/doc/source/example/processing/contrast_weighted_nearness.py index 9704ff106bbf974840ad4ba8286fe778dfbee43f..220863a1abe332baafab7d0bc5c24c3f23b932cf 100644 --- a/doc/source/example/processing/contrast_weighted_nearness.py +++ b/doc/source/example/processing/contrast_weighted_nearness.py @@ -11,7 +11,7 @@ mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.pcode.scene(mydb, rowid=rowid) +my_scene = mydb.scene(rowid=rowid) my_contrast = processing.pcode.contrast_weighted_nearness(my_scene) f, axarr = plt.subplots(2, 2, figsize=(15, 8)) diff --git a/doc/source/example/processing/michelson_contrast.py b/doc/source/example/processing/michelson_contrast.py index 4e05c76b55bd29e4cc60abeb65489cb724af5f6b..e7bb58c764eac18c265467c1d9046838c222d8d3 100644 --- a/doc/source/example/processing/michelson_contrast.py +++ b/doc/source/example/processing/michelson_contrast.py @@ -1,17 +1,18 @@ import matplotlib.pyplot as plt from navipy.database import DataBaseLoad import navipy.processing as processing -import os +import pkg_resources # 1) Connect to the database -mydb_filename = os.path.abspath('../database.db') +mydb_filename = pkg_resources.resource_filename( + 'navipy', 'resources/database.db') mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.scene(mydb, rowid=rowid) -my_contrast = processing.michelson_contrast(my_scene) +my_scene = mydb.scene(rowid=rowid) +my_contrast = processing.pcode.michelson_contrast(my_scene) f, axarr = plt.subplots(2, 2, figsize=(15, 8)) axarr = axarr.flatten() diff --git a/doc/source/example/processing/pcv.py b/doc/source/example/processing/pcv.py index d6251279ec3b0be4d1e3e7d0a3adfaa56eeb6ea0..6c2017ccb18e8489b38b03aa968051cf2816efd8 100644 --- a/doc/source/example/processing/pcv.py +++ b/doc/source/example/processing/pcv.py @@ -11,5 +11,5 @@ mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.pcode.scene(mydb, rowid=rowid) +my_scene = mydb.scene(rowid=rowid) my_pcv = processing.pcode.pcv(my_scene, mydb.viewing_directions) diff --git a/doc/source/example/processing/skyline.py b/doc/source/example/processing/skyline.py index 11ac0a7a19b91b485c046c6add0da1c89e7512fd..499bacb14a6b6f83fef09403fee3484646fd160d 100644 --- a/doc/source/example/processing/skyline.py +++ b/doc/source/example/processing/skyline.py @@ -1,17 +1,18 @@ import matplotlib.pyplot as plt from navipy.database import DataBaseLoad import navipy.processing as processing -import os +import pkg_resources # 1) Connect to the database -mydb_filename = os.path.abspath('../database.db') +mydb_filename = pkg_resources.resource_filename( + 'navipy', 'resources/database.db') mydb = DataBaseLoad(mydb_filename) # 2) Define the position-orinetation at which # we want the image rowid = 12 -my_scene = processing.scene(mydb, rowid=rowid) -my_skyline = processing.skyline(my_scene) +my_scene = mydb.scene(rowid=rowid) +my_skyline = processing.pcode.skyline(my_scene) f, axarr = plt.subplots(1, 2, figsize=(15, 4)) for chan_i, chan_n in enumerate(mydb.channels): diff --git a/doc/source/processing.rst b/doc/source/processing.rst index 40af2eb8917bcf95a03ed00d7c6d039b889ed92f..f637eefcbb62c8cd885d361dfa935cf0fd5e03b3 100644 --- a/doc/source/processing.rst +++ b/doc/source/processing.rst @@ -5,9 +5,6 @@ Processing a scene Place code ---------- -Scene -~~~~~ -.. autofunction:: navipy.processing.pcode.scene Skyline ~~~~~~~