-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtlseparation.scripts.html
More file actions
498 lines (380 loc) · 22.6 KB
/
tlseparation.scripts.html
File metadata and controls
498 lines (380 loc) · 22.6 KB
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tlseparation.scripts package — TLSeparation documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="tlseparation.utility package" href="tlseparation.utility.html" />
<link rel="prev" title="tlseparation.classification package" href="tlseparation.classification.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> TLSeparation
</a>
<div class="version">
1.3.2
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Table of Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="tlseparation.html">tlseparation package</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="tlseparation.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="tlseparation.classification.html">tlseparation.classification package</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">tlseparation.scripts package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-tlseparation.scripts.automated_separation">tlseparation.scripts.automated_separation module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-tlseparation.scripts.post_processing">tlseparation.scripts.post_processing module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-tlseparation.scripts">Module contents</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="tlseparation.utility.html">tlseparation.utility package</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="tlseparation.html#module-tlseparation">Module contents</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">CHANGELOG</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">TLSeparation</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li><a href="tlseparation.html">tlseparation package</a> »</li>
<li>tlseparation.scripts package</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/tlseparation.scripts.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="tlseparation-scripts-package">
<h1>tlseparation.scripts package<a class="headerlink" href="#tlseparation-scripts-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-tlseparation.scripts.automated_separation">
<span id="tlseparation-scripts-automated-separation-module"></span><h2>tlseparation.scripts.automated_separation module<a class="headerlink" href="#module-tlseparation.scripts.automated_separation" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="tlseparation.scripts.automated_separation.generic_tree">
<code class="descclassname">tlseparation.scripts.automated_separation.</code><code class="descname">generic_tree</code><span class="sig-paren">(</span><em>arr, knn_list=[40, 50, 80, 100, 120], voxel_size=0.05, retrace_steps=40</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/tlseparation/scripts/automated_separation.html#generic_tree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tlseparation.scripts.automated_separation.generic_tree" title="Permalink to this definition">¶</a></dt>
<dd><p>Run an automated separation of a single tree point cloud.</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"><dl class="first docutils">
<dt><strong>arr</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Three-dimensional point cloud of a single tree to perform the
wood-leaf separation. This should be a n-dimensional array (m x n)
containing a set of coordinates (n) over a set of points (m).</p>
</dd>
<dt><strong>knn_lst: list</strong></dt>
<dd><p class="first last">Set of knn values to use in the neighborhood search in classification
steps. This variable will be directly used in a step containing
the function reference_classification and its minimum and maximum
values will be used in a different step with threshold_classification
(both from classification.classify_wood). These values are directl
dependent of point density and were defined based on a medium point
density scenario (mean distance between points aroun 0.05m).
Therefore, for higher density point clouds it’s recommended the use of
larger knn values for optimal results.</p>
</dd>
<dt><strong>verbose</strong> <span class="classifier-delimiter">:</span> <span class="classifier">bool</span></dt>
<dd><p class="first last">Option to set (or not) verbose output.</p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>wood_final</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Wood point cloud.</p>
</dd>
<dt><strong>leaf_final</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Leaf point cloud.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="tlseparation.scripts.automated_separation.large_tree_3">
<code class="descclassname">tlseparation.scripts.automated_separation.</code><code class="descname">large_tree_3</code><span class="sig-paren">(</span><em>arr, class_file=[], knn_lst=[20, 40, 60, 80], gmm_nclasses=4, class_prob_threshold=0.95, cont_filt=True, cf_rad=None, verbose=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/tlseparation/scripts/automated_separation.html#large_tree_3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tlseparation.scripts.automated_separation.large_tree_3" title="Permalink to this definition">¶</a></dt>
<dd><p>Run an automated separation of a single tree point cloud.</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"><dl class="first docutils">
<dt><strong>arr</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Three-dimensional point cloud of a single tree to perform the
wood-leaf separation. This should be a n-dimensional array (m x n)
containing a set of coordinates (n) over a set of points (m).</p>
</dd>
<dt><strong>class_file</strong> <span class="classifier-delimiter">:</span> <span class="classifier">str</span></dt>
<dd><p class="first last">Path to classes reference values file. This file will be loaded and
its reference values are used to select wood and leaf classes.</p>
</dd>
<dt><strong>knn_lst: list</strong></dt>
<dd><p class="first last">Set of knn values to use in the neighborhood search in classification
steps. This variable will be directly used in a step containing
the function wlseparate_ref_voting and its minimum value will be used
in another step containing wlseparate_abs (both from
classification.wlseparate). These values are directly dependent of
point density and were defined based on a medium point density
scenario (mean distance between points aroun 0.05m). Therefore, for
higher density point clouds it’s recommended the use of larger knn
values for optimal results.</p>
</dd>
<dt><strong>gmm_nclasses: int</strong></dt>
<dd><p class="first last">Number of classes to use in Gaussian Mixture Classification. Default
is 4.</p>
</dd>
<dt><strong>cont_filt</strong> <span class="classifier-delimiter">:</span> <span class="classifier">boolean</span></dt>
<dd><p class="first last">Option to select if continuity_filter should be applied to wood and
leaf point clouds. Default is True.</p>
</dd>
<dt><strong>class_prob_threshold</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd><p class="first last">Classification probability threshold to filter classes. This aims to
avoid selecting points that are not confidently enough assigned to
any given class. Default is 0.95.</p>
</dd>
<dt><strong>cf_rad</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd><p class="first last">Continuity filter search radius.</p>
</dd>
<dt><strong>verbose</strong> <span class="classifier-delimiter">:</span> <span class="classifier">bool</span></dt>
<dd><p class="first last">Option to set (or not) verbose output.</p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>wood_final</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Wood point cloud.</p>
</dd>
<dt><strong>leaf_final</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Leaf point cloud.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="tlseparation.scripts.automated_separation.large_tree_4">
<code class="descclassname">tlseparation.scripts.automated_separation.</code><code class="descname">large_tree_4</code><span class="sig-paren">(</span><em>arr, class_file=[], knn_lst=[20, 40, 60, 80], gmm_nclasses=4, class_prob_threshold=0.95, cont_filt=True, cf_rad=None, verbose=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/tlseparation/scripts/automated_separation.html#large_tree_4"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tlseparation.scripts.automated_separation.large_tree_4" title="Permalink to this definition">¶</a></dt>
<dd><p>Run an automated separation of a single tree point cloud.</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"><dl class="first docutils">
<dt><strong>arr</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Three-dimensional point cloud of a single tree to perform the
wood-leaf separation. This should be a n-dimensional array (m x n)
containing a set of coordinates (n) over a set of points (m).</p>
</dd>
<dt><strong>class_file</strong> <span class="classifier-delimiter">:</span> <span class="classifier">str</span></dt>
<dd><p class="first last">Path to classes reference values file. This file will be loaded and
its reference values are used to select wood and leaf classes.</p>
</dd>
<dt><strong>knn_lst: list</strong></dt>
<dd><p class="first last">Set of knn values to use in the neighborhood search in classification
steps. This variable will be directly used in a step containing
the function wlseparate_ref_voting and its minimum value will be used
in another step containing wlseparate_abs (both from
classification.wlseparate). These values are directly dependent of
point density and were defined based on a medium point density
scenario (mean distance between points aroun 0.05m). Therefore, for
higher density point clouds it’s recommended the use of larger knn
values for optimal results.</p>
</dd>
<dt><strong>gmm_nclasses: int</strong></dt>
<dd><p class="first last">Number of classes to use in Gaussian Mixture Classification. Default
is 4.</p>
</dd>
<dt><strong>cont_filt</strong> <span class="classifier-delimiter">:</span> <span class="classifier">boolean</span></dt>
<dd><p class="first last">Option to select if continuity_filter should be applied to wood and
leaf point clouds. Default is True.</p>
</dd>
<dt><strong>class_prob_threshold</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd><p class="first last">Classification probability threshold to filter classes. This aims to
avoid selecting points that are not confidently enough assigned to
any given class. Default is 0.95.</p>
</dd>
<dt><strong>cf_rad</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd><p class="first last">Continuity filter search radius.</p>
</dd>
<dt><strong>verbose</strong> <span class="classifier-delimiter">:</span> <span class="classifier">bool</span></dt>
<dd><p class="first last">Option to set (or not) verbose output.</p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>wood_final</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Wood point cloud.</p>
</dd>
<dt><strong>leaf_final</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Leaf point cloud.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="tlseparation.scripts.automated_separation.nopath_generic_tree">
<code class="descclassname">tlseparation.scripts.automated_separation.</code><code class="descname">nopath_generic_tree</code><span class="sig-paren">(</span><em>arr, knn_list=[40, 50, 80, 100, 120]</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/tlseparation/scripts/automated_separation.html#nopath_generic_tree"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tlseparation.scripts.automated_separation.nopath_generic_tree" title="Permalink to this definition">¶</a></dt>
<dd><p>Run an automated separation of a single tree point cloud.</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"><dl class="first docutils">
<dt><strong>arr</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Three-dimensional point cloud of a single tree to perform the
wood-leaf separation. This should be a n-dimensional array (m x n)
containing a set of coordinates (n) over a set of points (m).</p>
</dd>
<dt><strong>knn_lst: list</strong></dt>
<dd><p class="first last">Set of knn values to use in the neighborhood search in classification
steps. This variable will be directly used in a step containing
the function reference_classification and its minimum and maximum
values will be used in a different step with threshold_classification
(both from classification.classify_wood). These values are directl
dependent of point density and were defined based on a medium point
density scenario (mean distance between points aroun 0.05m).
Therefore, for higher density point clouds it’s recommended the use of
larger knn values for optimal results.</p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>wood_final</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Wood point cloud.</p>
</dd>
<dt><strong>leaf_final</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Leaf point cloud.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-tlseparation.scripts.post_processing">
<span id="tlseparation-scripts-post-processing-module"></span><h2>tlseparation.scripts.post_processing module<a class="headerlink" href="#module-tlseparation.scripts.post_processing" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="tlseparation.scripts.post_processing.isolated_clusters">
<code class="descclassname">tlseparation.scripts.post_processing.</code><code class="descname">isolated_clusters</code><span class="sig-paren">(</span><em>arr</em>, <em>voxel_size=0.05</em>, <em>size_threshold=0.3</em>, <em>feature_threshold=0.6</em>, <em>min_pts=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/tlseparation/scripts/post_processing.html#isolated_clusters"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#tlseparation.scripts.post_processing.isolated_clusters" title="Permalink to this definition">¶</a></dt>
<dd><p>Performs a connected component analysis to cluster points from a point
cloud and filters them these clusters based on size and shape (geometric
feature).</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"><dl class="first docutils">
<dt><strong>arr</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">Three-dimensional (m x n) array of a point cloud, where the
coordinates are represented in the columns (n) and the points are
represented in the rows (m).</p>
</dd>
<dt><strong>voxel_size: float</strong></dt>
<dd><p class="first last">Distance used to generate voxels from point cloud in order to
perform the connected component analysis in 3D space.</p>
</dd>
<dt><strong>size_threshold</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int/float</span></dt>
<dd><p class="first last">Minimum size, on any dimension, for a cluster to be set as
valid (True)</p>
</dd>
<dt><strong>feature_threshold</strong> <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd><p class="first last">Minimum feature value for the cluster to be set as elongated (True).</p>
</dd>
<dt><strong>min_pts</strong> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd><p class="first last">Minimum number of points for the cluster to be set as valid (True).</p>
</dd>
</dl>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>filter_mask</strong> <span class="classifier-delimiter">:</span> <span class="classifier">array</span></dt>
<dd><p class="first last">1D mask array setting True for valid poins in ‘arr’ and False
otherwise.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-tlseparation.scripts">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-tlseparation.scripts" title="Permalink to this headline">¶</a></h2>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="tlseparation.utility.html" class="btn btn-neutral float-right" title="tlseparation.utility package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="tlseparation.classification.html" class="btn btn-neutral float-left" title="tlseparation.classification package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2017-2019, Matheus Boni Vicari
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>