pysdic 2.0.2__py3-none-any.whl

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.
Files changed (105) hide show
  1. pysdic/README.md +26 -0
  2. pysdic/__init__.py +340 -0
  3. pysdic/__version__.py +20 -0
  4. pysdic/_optionals.py +397 -0
  5. pysdic/_validation.py +844 -0
  6. pysdic/computer_vision/__init__.py +18 -0
  7. pysdic/computer_vision/compute_rays.py +166 -0
  8. pysdic/computer_vision/display_distortion_field.py +409 -0
  9. pysdic/computer_vision/distorting_images.py +399 -0
  10. pysdic/computer_vision/distorting_points.py +541 -0
  11. pysdic/computer_vision/intersect_rays.py +128 -0
  12. pysdic/computer_vision/optical_flow.py +711 -0
  13. pysdic/computer_vision/project_points.py +366 -0
  14. pysdic/cordin/__init__.py +28 -0
  15. pysdic/cordin/capture_reader.py +368 -0
  16. pysdic/core/__init__.py +22 -0
  17. pysdic/core/disflow_config.py +235 -0
  18. pysdic/core/lockable.py +240 -0
  19. pysdic/core/property_container.py +902 -0
  20. pysdic/core/serialization.py +627 -0
  21. pysdic/fem/__init__.py +82 -0
  22. pysdic/fem/_implemented_element_type.py +67 -0
  23. pysdic/fem/_validation.py +284 -0
  24. pysdic/fem/adjacency.py +1638 -0
  25. pysdic/fem/cast_rays.py +552 -0
  26. pysdic/fem/displacement_jacobian.py +468 -0
  27. pysdic/fem/gauss_points.py +812 -0
  28. pysdic/fem/geometry.py +635 -0
  29. pysdic/fem/locate_points.py +415 -0
  30. pysdic/fem/operations.py +2801 -0
  31. pysdic/fem/shape_functions.py +1465 -0
  32. pysdic/geometry/__init__.py +18 -0
  33. pysdic/geometry/_vtk_properties.py +104 -0
  34. pysdic/geometry/connectivity.py +1115 -0
  35. pysdic/geometry/create_2D_surface_meshes.py +372 -0
  36. pysdic/geometry/create_3D_surface_meshes.py +1067 -0
  37. pysdic/geometry/integration_points.py +1245 -0
  38. pysdic/geometry/mesh.py +3084 -0
  39. pysdic/geometry/mesh_conversion.py +351 -0
  40. pysdic/geometry/plotter3d.py +1248 -0
  41. pysdic/geometry/point_cloud.py +1658 -0
  42. pysdic/imaging/__init__.py +18 -0
  43. pysdic/imaging/camera.py +744 -0
  44. pysdic/imaging/image.py +1296 -0
  45. pysdic/imaging/image_plotter.py +1322 -0
  46. pysdic/imaging/mesh_projection.py +1370 -0
  47. pysdic/imaging/rect_bivariate_spline.py +567 -0
  48. pysdic/imaging/view.py +483 -0
  49. pysdic/numeric/__init__.py +55 -0
  50. pysdic/numeric/derivation.py +781 -0
  51. pysdic/numeric/polynomial_fitting.py +197 -0
  52. pysdic/parametrizations/__init__.py +18 -0
  53. pysdic/parametrizations/affine_parametrization.py +340 -0
  54. pysdic/parametrizations/parametrization.py +1928 -0
  55. pysdic/parametrizations/subset_parametrization.py +372 -0
  56. pysdic/resources/__init__.py +0 -0
  57. pysdic/resources/get_lena_image.py +60 -0
  58. pysdic/resources/lena_texture.png +0 -0
  59. pysdic/resources/pysdic_icon.png +0 -0
  60. pysdic/sdic/_sdic_term_caches.py +341 -0
  61. pysdic/sdic/_sdic_validation.py +72 -0
  62. pysdic/sdic/gl_correction.py +612 -0
  63. pysdic/sdic/initialization.py +449 -0
  64. pysdic/sdic/pairing.py +197 -0
  65. pysdic/sdic/problem.py +96 -0
  66. pysdic/sdic/residuals.py +449 -0
  67. pysdic/sdic/sdic.py +1683 -0
  68. pysdic/sdic/sdic_analysis.py +1941 -0
  69. pysdic/sdic/sdic_parametrization.py +359 -0
  70. pysdic/sdic/sdic_term.py +1341 -0
  71. pysdic/sdic/sdic_unknowns.py +222 -0
  72. pysdic/sdic/setups.py +368 -0
  73. pysdic/sdic/temporal_regularization_term.py +511 -0
  74. pysdic/synthetic/__init__.py +18 -0
  75. pysdic/synthetic/noise.py +326 -0
  76. pysdic/synthetic/speckle.py +186 -0
  77. pysdic/synthetic/synthetic_image.py +412 -0
  78. pysdic/transformation_optimizations/__init__.py +18 -0
  79. pysdic/transformation_optimizations/optimize_transformation_input_points.py +748 -0
  80. pysdic/transformation_optimizations/optimize_transformation_parameters.py +882 -0
  81. pysdic/transformations/__init__.py +18 -0
  82. pysdic/transformations/brown_distortion.py +824 -0
  83. pysdic/transformations/identity_transformation.py +281 -0
  84. pysdic/transformations/no_transformation.py +260 -0
  85. pysdic/transformations/pinhole_intrinsic.py +1009 -0
  86. pysdic/transformations/planar_homographic_extrinsic.py +638 -0
  87. pysdic/transformations/planar_rigid_extrinsic.py +603 -0
  88. pysdic/transformations/rays.py +127 -0
  89. pysdic/transformations/reparametrized_transformation.py +620 -0
  90. pysdic/transformations/rigid_extrinsic.py +1219 -0
  91. pysdic/transformations/transformation.py +2886 -0
  92. pysdic/transformations/world_plane_rigid_extrinsic.py +820 -0
  93. pysdic/transformations/zernike_distortion.py +1296 -0
  94. pysdic/workflows/__init__.py +93 -0
  95. pysdic/workflows/displacement_tools.py +272 -0
  96. pysdic/workflows/initialisation.py +442 -0
  97. pysdic/workflows/integration_points.py +388 -0
  98. pysdic/workflows/quality.py +449 -0
  99. pysdic/workflows/reference_shape.py +252 -0
  100. pysdic-2.0.2.dist-info/METADATA +853 -0
  101. pysdic-2.0.2.dist-info/RECORD +105 -0
  102. pysdic-2.0.2.dist-info/WHEEL +5 -0
  103. pysdic-2.0.2.dist-info/licenses/COPYING +674 -0
  104. pysdic-2.0.2.dist-info/licenses/LICENSE +674 -0
  105. pysdic-2.0.2.dist-info/top_level.txt +1 -0
pysdic/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Architecture of the `pysdic` package
2
+
3
+ This file gives the content of each sub-folder of the package, to put a new file in the
4
+ right place. The details of the classes and functions are in the documentation.
5
+
6
+ ## Sub-folders
7
+
8
+ | Folder | Content |
9
+ |---|---|
10
+ | `core` | Internal building blocks: serialization, lock, property container. |
11
+ | `resources` | Data shipped with the package (example textures). |
12
+ | `parametrizations` | Maps between parameter vectors, with their Jacobians. |
13
+ | `transformations` | Camera models (extrinsic, distortion, intrinsic), composition and reparametrization. |
14
+ | `transformation_optimizations` | Fit of the parameters or input points of transformations with `pysolvegn`. |
15
+ | `computer_vision` | Functions on raw arrays: projection, rays, distortion, optical flow. |
16
+ | `fem` | Finite element computations on raw arrays (shape functions, adjacency, ...). |
17
+ | `numeric` | Internal numerical tools: finite differences, polynomial fit. |
18
+ | `geometry` | Point clouds, meshes, integration points, mesh creation, 3D display. |
19
+ | `imaging` | Images, cameras, views, 2D display, and the functions combining a mesh and a camera. |
20
+ | `synthetic` | Speckle textures, synthetic images and noise. |
21
+ | `sdic` | The SDIC analysis, its setups, the unknowns, the terms and the residuals. |
22
+ | `workflows` | Bank of procedures built on the API (`pysdic.workflows.<function>`). |
23
+ | `cordin` | Reading of the CORDIN high-speed camera captures (`pysdic.cordin.<name>`). |
24
+
25
+ The files `_validation.py` (validation of the inputs) and `_optionals.py` (lazy import of
26
+ the optional dependencies) are shared by all the modules.
pysdic/__init__.py ADDED
@@ -0,0 +1,340 @@
1
+ """
2
+ pysdic - Python Stereo-Digital Image Correlation (Computer Vision
3
+ Cameras Models, Image Processing, Meshes and tools for SDIC analysis)
4
+ Copyright (C) 2026 Artezaru, artezaru.github@proton.me
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
18
+ """
19
+
20
+ from .__version__ import __version__
21
+
22
+ # =============================================================================
23
+ # Parametrizations and transformations
24
+ # =============================================================================
25
+ from .parametrizations.parametrization import (
26
+ ParametrizationResult,
27
+ Parametrization,
28
+ ComposedParametrization,
29
+ )
30
+ from .parametrizations.affine_parametrization import AffineParametrization
31
+ from .parametrizations.subset_parametrization import SubsetParametrization
32
+
33
+ from .transformations.transformation import (
34
+ TransformationResult,
35
+ Transformation,
36
+ ComposedTransformation,
37
+ )
38
+ from .transformations.reparametrized_transformation import ReparametrizedTransformation
39
+ from .transformations.rays import Rays
40
+ from .transformations.identity_transformation import IdentityTransformation
41
+ from .transformations.no_transformation import NoIntrinsic, NoDistortion, NoExtrinsic
42
+ from .transformations.pinhole_intrinsic import PinholeIntrinsic
43
+ from .transformations.brown_distortion import BrownDistortion
44
+ from .transformations.zernike_distortion import ZernikeDistortion, ZernikePolynomialsCache
45
+ from .transformations.rigid_extrinsic import (
46
+ RigidExtrinsic,
47
+ PerspectiveExtrinsic,
48
+ OrthographicExtrinsic,
49
+ )
50
+ from .transformations.world_plane_rigid_extrinsic import (
51
+ WorldPlanePerspectiveExtrinsic,
52
+ WorldPlaneOrthographicExtrinsic,
53
+ )
54
+ from .transformations.planar_rigid_extrinsic import PlanarRigidExtrinsic
55
+ from .transformations.planar_homographic_extrinsic import PlanarHomographicExtrinsic
56
+
57
+ # =============================================================================
58
+ # Optimization of transformations
59
+ # =============================================================================
60
+ from .transformation_optimizations.optimize_transformation_parameters import (
61
+ build_transformation_term,
62
+ build_chains_transformation_term,
63
+ optimize_transformation_parameters,
64
+ optimize_chains_transformation_parameters,
65
+ )
66
+ from .transformation_optimizations.optimize_transformation_input_points import (
67
+ build_transformation_input_points_term,
68
+ build_chains_transformation_input_points_term,
69
+ optimize_transformation_input_points,
70
+ optimize_chains_transformation_input_points,
71
+ )
72
+
73
+ # =============================================================================
74
+ # Computer vision
75
+ # =============================================================================
76
+ from .computer_vision.project_points import (
77
+ ProjectionResult,
78
+ compose_projection,
79
+ project_points,
80
+ )
81
+ from .computer_vision.distorting_points import (
82
+ DistortionResult,
83
+ distort_points,
84
+ undistort_points,
85
+ )
86
+ from .computer_vision.distorting_images import distort_image, undistort_image
87
+ from .computer_vision.display_distortion_field import display_distortion_field
88
+ from .computer_vision.compute_rays import compute_rays
89
+ from .computer_vision.intersect_rays import intersect_rays
90
+ from .computer_vision.optical_flow import (
91
+ compute_optical_flow,
92
+ display_optical_flow,
93
+ display_optical_flow_quiver,
94
+ )
95
+ from .core.disflow_config import DisflowConfig
96
+
97
+ # =============================================================================
98
+ # Resources
99
+ # =============================================================================
100
+ from .resources.get_lena_image import get_lena_image
101
+
102
+ # =============================================================================
103
+ # Geometry
104
+ # =============================================================================
105
+ from .geometry.point_cloud import PointCloud
106
+ from .geometry.connectivity import Connectivity
107
+ from .geometry.mesh import Mesh
108
+ from .geometry.integration_points import IntegrationPoints
109
+ from .geometry.mesh_conversion import (
110
+ quadrangle_4_to_triangle_3,
111
+ triangle_3_to_triangle_6,
112
+ quadrangle_4_to_quadrangle_8,
113
+ )
114
+ from .geometry.create_3D_surface_meshes import (
115
+ create_uniform_quadrangle_4_mesh,
116
+ create_3d_quadrangle_4_heightmap,
117
+ create_3d_triangle_3_heightmap,
118
+ create_3d_quadrangle_4_cylindrical,
119
+ create_3d_triangle_3_cylindrical,
120
+ create_3d_quadrangle_4_spherical,
121
+ create_3d_triangle_3_spherical,
122
+ )
123
+ from .geometry.create_2D_surface_meshes import (
124
+ create_2d_quadrangle_4_rectangle,
125
+ create_2d_triangle_3_rectangle,
126
+ create_2d_quadrangle_4_polar,
127
+ create_2d_triangle_3_polar,
128
+ )
129
+ from .geometry.plotter3d import Plotter3D
130
+
131
+ # =============================================================================
132
+ # Imaging
133
+ # =============================================================================
134
+ from .imaging.image import Image
135
+ from .imaging.camera import Camera
136
+ from .imaging.view import ImageProjectionResult, View
137
+ from .imaging.image_plotter import ImagePlotter
138
+ from .imaging.mesh_projection import (
139
+ compute_projected_bounding_box,
140
+ compute_projected_roi,
141
+ compute_projected_mesh_mask,
142
+ compute_projected_elements_areas,
143
+ compute_projected_uvmap,
144
+ compute_visibility,
145
+ compute_pixel_integration_points,
146
+ display_projected_bounding_box,
147
+ display_projected_roi,
148
+ display_projected_mesh_mask,
149
+ display_projected_elements_areas,
150
+ display_visibility,
151
+ display_pixel_integration_points,
152
+ )
153
+
154
+ # =============================================================================
155
+ # Synthetic images
156
+ # =============================================================================
157
+ from .synthetic.speckle import compute_wave_speckle
158
+ from .synthetic.noise import (
159
+ add_gaussian_blur,
160
+ add_poisson_noise,
161
+ add_gaussian_noise,
162
+ add_salt_and_pepper_noise,
163
+ quantize_image,
164
+ )
165
+ from .synthetic.synthetic_image import (
166
+ interpolate_texture,
167
+ generate_synthetic_image,
168
+ )
169
+
170
+ # =============================================================================
171
+ # SDIC
172
+ # =============================================================================
173
+ from .sdic.sdic_analysis import SDICAnalysis
174
+ from .sdic.setups import (
175
+ create_multicamera_analysis,
176
+ create_bicamera_analysis,
177
+ create_splitscreen_analysis,
178
+ create_cordin_analysis,
179
+ )
180
+ from .sdic.pairing import Pairing
181
+ from .sdic.gl_correction import (
182
+ GrayLevelGroups,
183
+ compute_gray_level_groups,
184
+ znssd_correction,
185
+ znssd_correction_exact,
186
+ matching_correction,
187
+ matching_correction_exact,
188
+ )
189
+ from .sdic.sdic_unknowns import SDICUnknowns
190
+ from .sdic.sdic_term import SDICCorrelationTerm
191
+ from .sdic.temporal_regularization_term import SDICTemporalRegularizationTerm
192
+ from .sdic.sdic_parametrization import (
193
+ compute_supported_vertices,
194
+ SDICFixedParametrization,
195
+ )
196
+ from .sdic.problem import check_same_problem
197
+ from .sdic.residuals import (
198
+ PairingResiduals,
199
+ compute_residuals,
200
+ compute_pixel_residual_maps,
201
+ display_residual_maps,
202
+ )
203
+
204
+ # =============================================================================
205
+ # Subpackages (called as pysdic.<subpackage>.<function>)
206
+ # =============================================================================
207
+ from . import cordin # Captures of the CORDIN high-speed cameras
208
+ from . import workflows # Bank of procedures built on the API
209
+
210
+
211
+ __all__ = [
212
+ "__version__",
213
+ # Parametrizations and transformations
214
+ "ParametrizationResult",
215
+ "Parametrization",
216
+ "ComposedParametrization",
217
+ "AffineParametrization",
218
+ "SubsetParametrization",
219
+ "TransformationResult",
220
+ "Transformation",
221
+ "ComposedTransformation",
222
+ "ReparametrizedTransformation",
223
+ "Rays",
224
+ "IdentityTransformation",
225
+ "NoIntrinsic",
226
+ "NoDistortion",
227
+ "NoExtrinsic",
228
+ "PinholeIntrinsic",
229
+ "BrownDistortion",
230
+ "ZernikeDistortion",
231
+ "ZernikePolynomialsCache",
232
+ "RigidExtrinsic",
233
+ "PerspectiveExtrinsic",
234
+ "OrthographicExtrinsic",
235
+ "WorldPlanePerspectiveExtrinsic",
236
+ "WorldPlaneOrthographicExtrinsic",
237
+ "PlanarRigidExtrinsic",
238
+ "PlanarHomographicExtrinsic",
239
+ # Optimization of transformations
240
+ "build_transformation_term",
241
+ "build_chains_transformation_term",
242
+ "optimize_transformation_parameters",
243
+ "optimize_chains_transformation_parameters",
244
+ "build_transformation_input_points_term",
245
+ "build_chains_transformation_input_points_term",
246
+ "optimize_transformation_input_points",
247
+ "optimize_chains_transformation_input_points",
248
+ # Computer vision
249
+ "ProjectionResult",
250
+ "compose_projection",
251
+ "project_points",
252
+ "DistortionResult",
253
+ "distort_points",
254
+ "undistort_points",
255
+ "distort_image",
256
+ "undistort_image",
257
+ "display_distortion_field",
258
+ "compute_rays",
259
+ "intersect_rays",
260
+ "compute_optical_flow",
261
+ "display_optical_flow",
262
+ "display_optical_flow_quiver",
263
+ "DisflowConfig",
264
+ # Resources
265
+ "get_lena_image",
266
+ # Geometry
267
+ "PointCloud",
268
+ "Connectivity",
269
+ "Mesh",
270
+ "IntegrationPoints",
271
+ "quadrangle_4_to_triangle_3",
272
+ "triangle_3_to_triangle_6",
273
+ "quadrangle_4_to_quadrangle_8",
274
+ "create_uniform_quadrangle_4_mesh",
275
+ "create_3d_quadrangle_4_heightmap",
276
+ "create_3d_triangle_3_heightmap",
277
+ "create_3d_quadrangle_4_cylindrical",
278
+ "create_3d_triangle_3_cylindrical",
279
+ "create_3d_quadrangle_4_spherical",
280
+ "create_3d_triangle_3_spherical",
281
+ "create_2d_quadrangle_4_rectangle",
282
+ "create_2d_triangle_3_rectangle",
283
+ "create_2d_quadrangle_4_polar",
284
+ "create_2d_triangle_3_polar",
285
+ "Plotter3D",
286
+ # Imaging
287
+ "Image",
288
+ "Camera",
289
+ "ImageProjectionResult",
290
+ "View",
291
+ "ImagePlotter",
292
+ "compute_projected_bounding_box",
293
+ "compute_projected_roi",
294
+ "compute_projected_mesh_mask",
295
+ "compute_projected_elements_areas",
296
+ "compute_projected_uvmap",
297
+ "compute_visibility",
298
+ "compute_pixel_integration_points",
299
+ "display_projected_bounding_box",
300
+ "display_projected_roi",
301
+ "display_projected_mesh_mask",
302
+ "display_projected_elements_areas",
303
+ "display_visibility",
304
+ "display_pixel_integration_points",
305
+ # Synthetic images
306
+ "compute_wave_speckle",
307
+ "add_gaussian_blur",
308
+ "add_poisson_noise",
309
+ "add_gaussian_noise",
310
+ "add_salt_and_pepper_noise",
311
+ "quantize_image",
312
+ "interpolate_texture",
313
+ "generate_synthetic_image",
314
+ # SDIC
315
+ "SDICAnalysis",
316
+ "create_multicamera_analysis",
317
+ "create_bicamera_analysis",
318
+ "create_splitscreen_analysis",
319
+ "create_cordin_analysis",
320
+ "Pairing",
321
+ "GrayLevelGroups",
322
+ "compute_gray_level_groups",
323
+ "znssd_correction",
324
+ "znssd_correction_exact",
325
+ "matching_correction",
326
+ "matching_correction_exact",
327
+ "SDICUnknowns",
328
+ "SDICCorrelationTerm",
329
+ "SDICTemporalRegularizationTerm",
330
+ "compute_supported_vertices",
331
+ "SDICFixedParametrization",
332
+ "check_same_problem",
333
+ "PairingResiduals",
334
+ "compute_residuals",
335
+ "compute_pixel_residual_maps",
336
+ "display_residual_maps",
337
+ # Subpackages
338
+ "cordin",
339
+ "workflows",
340
+ ]
pysdic/__version__.py ADDED
@@ -0,0 +1,20 @@
1
+ """
2
+ pysdic - Python Stereo-Digital Image Correlation (Computer Vision
3
+ Cameras Models, Image Processing, Meshes and tools for SDIC analysis)
4
+ Copyright (C) 2026 Artezaru, artezaru.github@proton.me
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
18
+ """
19
+
20
+ __version__ = "2.0.2"