pandora 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pandora-0.2.1/.gitignore +6 -0
- pandora-0.2.1/LICENSE +202 -0
- pandora-0.2.1/MANIFEST.in +1 -0
- pandora-0.2.1/NOTICE +71 -0
- pandora-0.2.1/PKG-INFO +180 -0
- pandora-0.2.1/README.md +168 -0
- pandora-0.2.1/bin/Pandora.py +53 -0
- pandora-0.2.1/bin/__init__.py +20 -0
- pandora-0.2.1/conf/medicis.json +29 -0
- pandora-0.2.1/doc/Makefile +40 -0
- pandora-0.2.1/doc/make.bat +54 -0
- pandora-0.2.1/doc/sources/Images/Directions_interpolation_sgm.png +0 -0
- pandora-0.2.1/doc/sources/Images/Directions_mc_cnn.png +0 -0
- pandora-0.2.1/doc/sources/Images/Quadratic.png +0 -0
- pandora-0.2.1/doc/sources/Images/Vfit.png +0 -0
- pandora-0.2.1/doc/sources/conf.py +95 -0
- pandora-0.2.1/doc/sources/developer_guide/before_coding.rst +14 -0
- pandora-0.2.1/doc/sources/developer_guide/your_plugin.rst +97 -0
- pandora-0.2.1/doc/sources/developer_guide.rst +7 -0
- pandora-0.2.1/doc/sources/getting_started/examples.rst +95 -0
- pandora-0.2.1/doc/sources/getting_started/installation.rst +26 -0
- pandora-0.2.1/doc/sources/getting_started/quick_overview.rst +26 -0
- pandora-0.2.1/doc/sources/getting_started.rst +7 -0
- pandora-0.2.1/doc/sources/index.rst +26 -0
- pandora-0.2.1/doc/sources/userguide/pandora_data.rst +209 -0
- pandora-0.2.1/doc/sources/userguide/step_by_step.rst +190 -0
- pandora-0.2.1/doc/sources/userguide/usage.rst +281 -0
- pandora-0.2.1/doc/sources/userguide.rst +11 -0
- pandora-0.2.1/pandora/JSON_checker.py +466 -0
- pandora-0.2.1/pandora/__init__.py +211 -0
- pandora-0.2.1/pandora/aggregation/__init__.py +22 -0
- pandora-0.2.1/pandora/aggregation/aggregation.py +176 -0
- pandora-0.2.1/pandora/aggregation/cbca.py +368 -0
- pandora-0.2.1/pandora/common.py +124 -0
- pandora-0.2.1/pandora/constants.py +49 -0
- pandora-0.2.1/pandora/disparity.py +477 -0
- pandora-0.2.1/pandora/filter/__init__.py +23 -0
- pandora-0.2.1/pandora/filter/bilateral.py +112 -0
- pandora-0.2.1/pandora/filter/filter.py +174 -0
- pandora-0.2.1/pandora/filter/median.py +149 -0
- pandora-0.2.1/pandora/img_tools.py +285 -0
- pandora-0.2.1/pandora/marge.py +85 -0
- pandora-0.2.1/pandora/optimization/__init__.py +21 -0
- pandora-0.2.1/pandora/optimization/optimization.py +164 -0
- pandora-0.2.1/pandora/output_tree_design.py +55 -0
- pandora-0.2.1/pandora/refinement/__init__.py +23 -0
- pandora-0.2.1/pandora/refinement/quadratic.py +209 -0
- pandora-0.2.1/pandora/refinement/refinement.py +396 -0
- pandora-0.2.1/pandora/refinement/vfit.py +220 -0
- pandora-0.2.1/pandora/stereo/__init__.py +24 -0
- pandora-0.2.1/pandora/stereo/census.py +229 -0
- pandora-0.2.1/pandora/stereo/sad_ssd.py +279 -0
- pandora-0.2.1/pandora/stereo/stereo.py +316 -0
- pandora-0.2.1/pandora/stereo/zncc.py +194 -0
- pandora-0.2.1/pandora/validation/__init__.py +22 -0
- pandora-0.2.1/pandora/validation/interpolated_disparity.py +583 -0
- pandora-0.2.1/pandora/validation/validation.py +396 -0
- pandora-0.2.1/pandora.egg-info/PKG-INFO +180 -0
- pandora-0.2.1/pandora.egg-info/SOURCES.txt +81 -0
- pandora-0.2.1/pandora.egg-info/dependency_links.txt +1 -0
- pandora-0.2.1/pandora.egg-info/entry_points.txt +3 -0
- pandora-0.2.1/pandora.egg-info/requires.txt +8 -0
- pandora-0.2.1/pandora.egg-info/top_level.txt +2 -0
- pandora-0.2.1/setup.cfg +4 -0
- pandora-0.2.1/setup.py +73 -0
- pandora-0.2.1/sonar-project.properties +24 -0
- pandora-0.2.1/tests/image/mask_ref.tif +0 -0
- pandora-0.2.1/tests/image/ref_img.tif +0 -0
- pandora-0.2.1/tests/pandora/cfg.json +33 -0
- pandora-0.2.1/tests/pandora/disp_ref.tif +0 -0
- pandora-0.2.1/tests/pandora/disp_sec.tif +0 -0
- pandora-0.2.1/tests/pandora/occlusion.png +0 -0
- pandora-0.2.1/tests/pandora/ref.png +0 -0
- pandora-0.2.1/tests/pandora/sec.png +0 -0
- pandora-0.2.1/tests/test_aggregation.py +200 -0
- pandora-0.2.1/tests/test_disparity.py +829 -0
- pandora-0.2.1/tests/test_filter.py +249 -0
- pandora-0.2.1/tests/test_marge.py +104 -0
- pandora-0.2.1/tests/test_pandora.py +336 -0
- pandora-0.2.1/tests/test_pandora_image.py +212 -0
- pandora-0.2.1/tests/test_refinement.py +245 -0
- pandora-0.2.1/tests/test_stereo.py +1068 -0
- pandora-0.2.1/tests/test_validation.py +350 -0
pandora-0.2.1/.gitignore
ADDED
pandora-0.2.1/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include README.md
|
pandora-0.2.1/NOTICE
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
PANDORA Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
|
|
2
|
+
|
|
3
|
+
This software is distributed under the Apache Software License (ASL) v2.0, see
|
|
4
|
+
LICENSE file or http://www.apache.org/licenses/LICENSE-2.0 for details.
|
|
5
|
+
|
|
6
|
+
PANDORA depends on or includes source code from the following third-party
|
|
7
|
+
software:
|
|
8
|
+
|
|
9
|
+
Python: programming language that lets you work quickly and integrate systems more effectively.
|
|
10
|
+
Copyright (c) 2001-2020 Python Software Foundation. All Rights reserved.
|
|
11
|
+
Website: http://python.org/
|
|
12
|
+
License: Python Software License.
|
|
13
|
+
|
|
14
|
+
NumPy: The fundamental package for scientific computing with Python.
|
|
15
|
+
Copyright (c) 2005-2020, NumPy Developers.
|
|
16
|
+
Website: https://numpy.org/
|
|
17
|
+
License: BSD 3 Clause.
|
|
18
|
+
|
|
19
|
+
SciPy: open-source software for mathematics, science, and engineering.
|
|
20
|
+
Copyright (c) 2001, 2002 Enthought, Inc. All rights reserved.
|
|
21
|
+
Copyright (c) 2003-2019 SciPy Developers. All rights reserved.
|
|
22
|
+
Website: https://www.scipy.org/scipylib/
|
|
23
|
+
License: BSD 3 Clause.
|
|
24
|
+
|
|
25
|
+
Setuptools: build system
|
|
26
|
+
Copyright (C) 2016 Jason R Coombs <jaraco@jaraco.com>
|
|
27
|
+
Website: https://setuptools.readthedocs.io/
|
|
28
|
+
License: MIT.
|
|
29
|
+
|
|
30
|
+
Numba: NumPy aware dynamic Python compiler using LLVM
|
|
31
|
+
Copyright (c) 2012, Anaconda, Inc.
|
|
32
|
+
Website: https://numba.pydata.org/
|
|
33
|
+
License: BSD 2 Clause.
|
|
34
|
+
|
|
35
|
+
Xarray: N-D labeled arrays and datasets in Python
|
|
36
|
+
Copyright 2014-2019, xarray Developers
|
|
37
|
+
Website: http://xarray.pydata.org
|
|
38
|
+
License: Apache v2.0.
|
|
39
|
+
|
|
40
|
+
json_checker: Validate json data and etc...
|
|
41
|
+
Copyright (c) 2018 Denis Korytkin
|
|
42
|
+
Website: https://github.com/DKorytkin/json_checker
|
|
43
|
+
License: MIT.
|
|
44
|
+
|
|
45
|
+
Rasterio: access to geospatial raster data
|
|
46
|
+
Copyright (c) 2016, MapBox All rights reserved.
|
|
47
|
+
Website: https://github.com/mapbox/rasterio
|
|
48
|
+
License: BSD 3 Clause.
|
|
49
|
+
|
|
50
|
+
Sphinx-doc: Tool to create documentation for Python projects
|
|
51
|
+
Copyright (c) 2007-2019 by the Sphinx team
|
|
52
|
+
Website: https://www.sphinx-doc.org/
|
|
53
|
+
License: BSD 2 Clause.
|
|
54
|
+
|
|
55
|
+
OpenCV: Open Source Computer Vision Library
|
|
56
|
+
Copyright (c) 2000-2019, Intel Corporation, all rights reserved.
|
|
57
|
+
Copyright (c) 2009-2011, Willow Garage Inc., all rights reserved.
|
|
58
|
+
Copyright (c) 2009-2016, NVIDIA Corporation, all rights reserved.
|
|
59
|
+
Copyright (c) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
|
60
|
+
Copyright (c) 2015-2016, OpenCV Foundation, all rights reserved.
|
|
61
|
+
Copyright (c) 2015-2016, Itseez Inc., all rights reserved.
|
|
62
|
+
Copyright (c) 2019-2020, Xperience AI, all rights reserved.
|
|
63
|
+
Website: https://opencv.org/
|
|
64
|
+
License: BSD 3 Clause.
|
|
65
|
+
|
|
66
|
+
Nose2: Testing module for Python codes
|
|
67
|
+
Copyright (c) 2012, Jason Pellerin
|
|
68
|
+
Copyright (c) 2001-2012
|
|
69
|
+
Python Software Foundation
|
|
70
|
+
Website: https://github.com/nose-devs/nose2
|
|
71
|
+
License: BSD 2 Clause.
|
pandora-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pandora
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Pandora is a stereo matching framework that helps emulate state of the art algorithms
|
|
5
|
+
Home-page: https://github.com/CNES/Pandora_pandora
|
|
6
|
+
Author: CNES
|
|
7
|
+
Author-email: myriam.cournet@cnes.fr
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Description: # Pandora
|
|
10
|
+
|
|
11
|
+
This CNES software implements a stereo pipeline which produces disparity map from a pair of images. Several state-of-the-art
|
|
12
|
+
stereo algorithms are available. The implementation is modular and can easily be ex-tended to include other
|
|
13
|
+
algorithms.
|
|
14
|
+
|
|
15
|
+
The pipeline performs the following steps:
|
|
16
|
+
|
|
17
|
+
1. matching cost computation
|
|
18
|
+
2. cost (support) aggregation
|
|
19
|
+
3. optimization
|
|
20
|
+
3. disparity computation
|
|
21
|
+
4. subpixel cost refinement
|
|
22
|
+
5. disparity filter, validation
|
|
23
|
+
|
|
24
|
+
## Dependencies
|
|
25
|
+
|
|
26
|
+
Dependencies are :
|
|
27
|
+
|
|
28
|
+
python >= 3.6, pip, nose2, xarray >= 0.13.*, numpy, scipy, numba >= 0.47.*, rasterio, opencv-python,
|
|
29
|
+
json-checker
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install pandora
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**From sources**
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/CNES/Pandora_pandora.git
|
|
41
|
+
cd Pandora_pandora
|
|
42
|
+
pip install .
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Build documentation**
|
|
46
|
+
|
|
47
|
+
Make sure latex and dvipng are already installed
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
pip install sphinx-rtd-theme
|
|
51
|
+
pip install sphinx-autoapi
|
|
52
|
+
python setup.py build_sphinx
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Documentation is built in pandora/doc/build/html
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
Run the python script `pandora` with a json configuration file (see `conf` folder as an example) and the following arguments :
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
usage: pandora [-h] [-v] config
|
|
63
|
+
|
|
64
|
+
Pandora stereo matching
|
|
65
|
+
|
|
66
|
+
positional arguments:
|
|
67
|
+
output_dir Path to the output director
|
|
68
|
+
config Path to a json file containing the input files paths and the algorithm parameters
|
|
69
|
+
|
|
70
|
+
optional arguments:
|
|
71
|
+
-h, --help show this help message and exit
|
|
72
|
+
-v, --verbose Increase output verbosity
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The config file `config.json` is formatted as :
|
|
76
|
+
|
|
77
|
+
{
|
|
78
|
+
"input" : {
|
|
79
|
+
"img_ref" : "PATH/TO/img_ref.tif",
|
|
80
|
+
"img_sec" : "PATH/TO/img_sec.tif",
|
|
81
|
+
"disp_min" : -100,
|
|
82
|
+
"disp_max" : 100,
|
|
83
|
+
"ref_mask" : "PATH/TO/ref_mask.tif",
|
|
84
|
+
"sec_mask" : "PATH/TO/sec_mask.tif"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
Mandatory fields are :
|
|
89
|
+
- `img_ref` : Path to the reference image
|
|
90
|
+
- `img_sec` : Path to the secondary image
|
|
91
|
+
- `disp_min` : Minimal disparity
|
|
92
|
+
- `disp_max` : Maximal disparity
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
Optional fields are :
|
|
96
|
+
- `ref_mask` : Path to the reference mask
|
|
97
|
+
- `sec_mask` : Path to the secondary mask
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
Pandora can also be used as a package :
|
|
102
|
+
|
|
103
|
+
import pandora
|
|
104
|
+
|
|
105
|
+
Input stereo images must be grayscale images. Parameters `nodata1` and `nodata2` of the json configuration file allow to specify
|
|
106
|
+
the value of no data in the reference and secondary images.
|
|
107
|
+
|
|
108
|
+
The masks are optional, and have the following convention: 0 is a valid pixel, everything else is considered as masked.
|
|
109
|
+
|
|
110
|
+
All the parameters of the algorithm are stored in the json file. Configuration examples are available in the `conf` folder.
|
|
111
|
+
The file `pandora/config.py` lists all possible parameters and provides some explanations on the role of these parameters.
|
|
112
|
+
The following paragraphs describe the methods currently implemented for each step of the pipeline.
|
|
113
|
+
|
|
114
|
+
#### Matching cost computation
|
|
115
|
+
|
|
116
|
+
The first step calculates a cost volume from the two images and one of the following similarity measures:
|
|
117
|
+
|
|
118
|
+
- Sum of absolute differences
|
|
119
|
+
- Sum of squared differences
|
|
120
|
+
- Census
|
|
121
|
+
- Zero mean normalized cross correlation
|
|
122
|
+
|
|
123
|
+
#### Cost (support) aggregation
|
|
124
|
+
|
|
125
|
+
Aggregate the matching cost by summing or averaging over a support region in the cost volume:
|
|
126
|
+
|
|
127
|
+
- Cross-based Cost Aggregation
|
|
128
|
+
|
|
129
|
+
#### Optimization
|
|
130
|
+
|
|
131
|
+
Find a disparity function that minimizes a global energy in the cost volume:
|
|
132
|
+
|
|
133
|
+
- Semi-Global Matching, by using [pugin_libsgm](https://github.com/CNES/Pandora_plugin_libsgm.git) and [libsgm](https://github.com/CNES/Pandora_libsgm.git)
|
|
134
|
+
|
|
135
|
+
SGM reference: [H. Hirschmuller. Stereo processing by semiglobal matching and mutual information.
|
|
136
|
+
IEEE Transactions on pattern analysis and machine intelligence, 2007, vol. 30, no 2, p. 328-341]
|
|
137
|
+
|
|
138
|
+
#### Disparity computation
|
|
139
|
+
|
|
140
|
+
Choose at each pixel the disparity associated with the minimum cost:
|
|
141
|
+
|
|
142
|
+
- Winner-take-all
|
|
143
|
+
|
|
144
|
+
#### Subpixel cost refinement
|
|
145
|
+
|
|
146
|
+
The sub-pixel refinement of disparities:
|
|
147
|
+
|
|
148
|
+
- vfit
|
|
149
|
+
- quadratic
|
|
150
|
+
|
|
151
|
+
#### Disparity filter, validation
|
|
152
|
+
|
|
153
|
+
Post-processing the computed disparities:
|
|
154
|
+
|
|
155
|
+
- median filter
|
|
156
|
+
- bilateral filter
|
|
157
|
+
- cross checking
|
|
158
|
+
- mismatches and occlusions detection
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
## Notes
|
|
162
|
+
|
|
163
|
+
For tests, we use images coming from 2003 Middleburry dataset
|
|
164
|
+
(D. Scharstein and R. Szeliski. High-accuracy stereo depth maps using structured light.
|
|
165
|
+
In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2003),
|
|
166
|
+
volume 1, pages 195-202, Madison, WI, June 2003.)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
## References
|
|
170
|
+
|
|
171
|
+
If you use this CNES software, please cite the following paper:
|
|
172
|
+
|
|
173
|
+
Cournet, M., Sarrazin, E., Dumas, L., Michel, J., Guinet, J., Youssefi, D., Defonte, V., Fardet, Q., 2020.
|
|
174
|
+
Ground-truth generation and disparity estimation for optical satellite imagery.
|
|
175
|
+
ISPRS - International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences.
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
Platform: UNKNOWN
|
|
179
|
+
Requires-Python: >=3.6
|
|
180
|
+
Description-Content-Type: text/markdown
|
pandora-0.2.1/README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Pandora
|
|
2
|
+
|
|
3
|
+
This CNES software implements a stereo pipeline which produces disparity map from a pair of images. Several state-of-the-art
|
|
4
|
+
stereo algorithms are available. The implementation is modular and can easily be ex-tended to include other
|
|
5
|
+
algorithms.
|
|
6
|
+
|
|
7
|
+
The pipeline performs the following steps:
|
|
8
|
+
|
|
9
|
+
1. matching cost computation
|
|
10
|
+
2. cost (support) aggregation
|
|
11
|
+
3. optimization
|
|
12
|
+
3. disparity computation
|
|
13
|
+
4. subpixel cost refinement
|
|
14
|
+
5. disparity filter, validation
|
|
15
|
+
|
|
16
|
+
## Dependencies
|
|
17
|
+
|
|
18
|
+
Dependencies are :
|
|
19
|
+
|
|
20
|
+
python >= 3.6, pip, nose2, xarray >= 0.13.*, numpy, scipy, numba >= 0.47.*, rasterio, opencv-python,
|
|
21
|
+
json-checker
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install pandora
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**From sources**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/CNES/Pandora_pandora.git
|
|
33
|
+
cd Pandora_pandora
|
|
34
|
+
pip install .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Build documentation**
|
|
38
|
+
|
|
39
|
+
Make sure latex and dvipng are already installed
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
pip install sphinx-rtd-theme
|
|
43
|
+
pip install sphinx-autoapi
|
|
44
|
+
python setup.py build_sphinx
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Documentation is built in pandora/doc/build/html
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
Run the python script `pandora` with a json configuration file (see `conf` folder as an example) and the following arguments :
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
usage: pandora [-h] [-v] config
|
|
55
|
+
|
|
56
|
+
Pandora stereo matching
|
|
57
|
+
|
|
58
|
+
positional arguments:
|
|
59
|
+
output_dir Path to the output director
|
|
60
|
+
config Path to a json file containing the input files paths and the algorithm parameters
|
|
61
|
+
|
|
62
|
+
optional arguments:
|
|
63
|
+
-h, --help show this help message and exit
|
|
64
|
+
-v, --verbose Increase output verbosity
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The config file `config.json` is formatted as :
|
|
68
|
+
|
|
69
|
+
{
|
|
70
|
+
"input" : {
|
|
71
|
+
"img_ref" : "PATH/TO/img_ref.tif",
|
|
72
|
+
"img_sec" : "PATH/TO/img_sec.tif",
|
|
73
|
+
"disp_min" : -100,
|
|
74
|
+
"disp_max" : 100,
|
|
75
|
+
"ref_mask" : "PATH/TO/ref_mask.tif",
|
|
76
|
+
"sec_mask" : "PATH/TO/sec_mask.tif"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Mandatory fields are :
|
|
81
|
+
- `img_ref` : Path to the reference image
|
|
82
|
+
- `img_sec` : Path to the secondary image
|
|
83
|
+
- `disp_min` : Minimal disparity
|
|
84
|
+
- `disp_max` : Maximal disparity
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
Optional fields are :
|
|
88
|
+
- `ref_mask` : Path to the reference mask
|
|
89
|
+
- `sec_mask` : Path to the secondary mask
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
Pandora can also be used as a package :
|
|
94
|
+
|
|
95
|
+
import pandora
|
|
96
|
+
|
|
97
|
+
Input stereo images must be grayscale images. Parameters `nodata1` and `nodata2` of the json configuration file allow to specify
|
|
98
|
+
the value of no data in the reference and secondary images.
|
|
99
|
+
|
|
100
|
+
The masks are optional, and have the following convention: 0 is a valid pixel, everything else is considered as masked.
|
|
101
|
+
|
|
102
|
+
All the parameters of the algorithm are stored in the json file. Configuration examples are available in the `conf` folder.
|
|
103
|
+
The file `pandora/config.py` lists all possible parameters and provides some explanations on the role of these parameters.
|
|
104
|
+
The following paragraphs describe the methods currently implemented for each step of the pipeline.
|
|
105
|
+
|
|
106
|
+
#### Matching cost computation
|
|
107
|
+
|
|
108
|
+
The first step calculates a cost volume from the two images and one of the following similarity measures:
|
|
109
|
+
|
|
110
|
+
- Sum of absolute differences
|
|
111
|
+
- Sum of squared differences
|
|
112
|
+
- Census
|
|
113
|
+
- Zero mean normalized cross correlation
|
|
114
|
+
|
|
115
|
+
#### Cost (support) aggregation
|
|
116
|
+
|
|
117
|
+
Aggregate the matching cost by summing or averaging over a support region in the cost volume:
|
|
118
|
+
|
|
119
|
+
- Cross-based Cost Aggregation
|
|
120
|
+
|
|
121
|
+
#### Optimization
|
|
122
|
+
|
|
123
|
+
Find a disparity function that minimizes a global energy in the cost volume:
|
|
124
|
+
|
|
125
|
+
- Semi-Global Matching, by using [pugin_libsgm](https://github.com/CNES/Pandora_plugin_libsgm.git) and [libsgm](https://github.com/CNES/Pandora_libsgm.git)
|
|
126
|
+
|
|
127
|
+
SGM reference: [H. Hirschmuller. Stereo processing by semiglobal matching and mutual information.
|
|
128
|
+
IEEE Transactions on pattern analysis and machine intelligence, 2007, vol. 30, no 2, p. 328-341]
|
|
129
|
+
|
|
130
|
+
#### Disparity computation
|
|
131
|
+
|
|
132
|
+
Choose at each pixel the disparity associated with the minimum cost:
|
|
133
|
+
|
|
134
|
+
- Winner-take-all
|
|
135
|
+
|
|
136
|
+
#### Subpixel cost refinement
|
|
137
|
+
|
|
138
|
+
The sub-pixel refinement of disparities:
|
|
139
|
+
|
|
140
|
+
- vfit
|
|
141
|
+
- quadratic
|
|
142
|
+
|
|
143
|
+
#### Disparity filter, validation
|
|
144
|
+
|
|
145
|
+
Post-processing the computed disparities:
|
|
146
|
+
|
|
147
|
+
- median filter
|
|
148
|
+
- bilateral filter
|
|
149
|
+
- cross checking
|
|
150
|
+
- mismatches and occlusions detection
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## Notes
|
|
154
|
+
|
|
155
|
+
For tests, we use images coming from 2003 Middleburry dataset
|
|
156
|
+
(D. Scharstein and R. Szeliski. High-accuracy stereo depth maps using structured light.
|
|
157
|
+
In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2003),
|
|
158
|
+
volume 1, pages 195-202, Madison, WI, June 2003.)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
## References
|
|
162
|
+
|
|
163
|
+
If you use this CNES software, please cite the following paper:
|
|
164
|
+
|
|
165
|
+
Cournet, M., Sarrazin, E., Dumas, L., Michel, J., Guinet, J., Youssefi, D., Defonte, V., Fardet, Q., 2020.
|
|
166
|
+
Ground-truth generation and disparity estimation for optical satellite imagery.
|
|
167
|
+
ISPRS - International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences.
|
|
168
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# coding: utf8
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
|
|
5
|
+
#
|
|
6
|
+
# This file is part of PANDORA
|
|
7
|
+
#
|
|
8
|
+
# https://github.com/CNES/Pandora_pandora
|
|
9
|
+
#
|
|
10
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
# you may not use this file except in compliance with the License.
|
|
12
|
+
# You may obtain a copy of the License at
|
|
13
|
+
#
|
|
14
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
#
|
|
16
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
# See the License for the specific language governing permissions and
|
|
20
|
+
# limitations under the License.
|
|
21
|
+
#
|
|
22
|
+
"""
|
|
23
|
+
This module contains the general function to run Pandora pipeline.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
import argparse
|
|
27
|
+
import pandora
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def get_parser():
|
|
31
|
+
"""
|
|
32
|
+
ArgumentParser for Pandora
|
|
33
|
+
|
|
34
|
+
:return parser
|
|
35
|
+
"""
|
|
36
|
+
parser = argparse.ArgumentParser(description='Pandora stereo matching')
|
|
37
|
+
parser.add_argument('config', help='Path to a json file containing the input files paths and algorithm parameters')
|
|
38
|
+
parser.add_argument('output_dir', help='Path to the output directory')
|
|
39
|
+
parser.add_argument("-v", "--verbose", help="Increase output verbosity", action="store_true")
|
|
40
|
+
return parser
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def main():
|
|
44
|
+
# Get parser
|
|
45
|
+
parser = get_parser()
|
|
46
|
+
args = parser.parse_args()
|
|
47
|
+
|
|
48
|
+
# Run the Pandora pipeline
|
|
49
|
+
pandora.main(args.config, args.output_dir, args.verbose)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if __name__ == '__main__':
|
|
53
|
+
main()
|