shinestacker 1.0.4.post2__tar.gz → 1.2.0__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.

Potentially problematic release.


This version of shinestacker might be problematic. Click here for more details.

Files changed (143) hide show
  1. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/CHANGELOG.md +31 -1
  2. {shinestacker-1.0.4.post2/src/shinestacker.egg-info → shinestacker-1.2.0}/PKG-INFO +20 -1
  3. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/README.md +19 -0
  4. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/alignment.md +2 -2
  5. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/balancing.md +7 -2
  6. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/focus_stacking.md +19 -1
  7. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/main.md +2 -3
  8. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/vignetting.md +1 -0
  9. shinestacker-1.2.0/src/shinestacker/_version.py +1 -0
  10. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/__init__.py +4 -1
  11. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/align.py +128 -14
  12. shinestacker-1.2.0/src/shinestacker/algorithms/balance.py +615 -0
  13. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/base_stack_algo.py +33 -4
  14. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/depth_map.py +9 -12
  15. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/multilayer.py +12 -2
  16. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/noise_detection.py +8 -3
  17. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/pyramid.py +57 -42
  18. shinestacker-1.2.0/src/shinestacker/algorithms/pyramid_auto.py +141 -0
  19. shinestacker-1.2.0/src/shinestacker/algorithms/pyramid_tiles.py +264 -0
  20. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/stack.py +14 -11
  21. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/stack_framework.py +17 -11
  22. shinestacker-1.2.0/src/shinestacker/algorithms/utils.py +305 -0
  23. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/vignetting.py +23 -5
  24. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/config/constants.py +31 -5
  25. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/action_config.py +6 -7
  26. shinestacker-1.2.0/src/shinestacker/gui/action_config_dialog.py +734 -0
  27. shinestacker-1.2.0/src/shinestacker/gui/base_form_dialog.py +23 -0
  28. shinestacker-1.2.0/src/shinestacker/gui/flow_layout.py +105 -0
  29. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/gui_run.py +24 -19
  30. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/main_window.py +4 -3
  31. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/menu_manager.py +12 -2
  32. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/new_project.py +28 -22
  33. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/project_controller.py +40 -23
  34. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/project_converter.py +6 -6
  35. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/project_editor.py +21 -7
  36. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/time_progress_bar.py +2 -2
  37. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/exif_data.py +5 -5
  38. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/shortcuts_help.py +4 -4
  39. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/vignetting_filter.py +12 -8
  40. {shinestacker-1.0.4.post2 → shinestacker-1.2.0/src/shinestacker.egg-info}/PKG-INFO +20 -1
  41. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker.egg-info/SOURCES.txt +3 -0
  42. shinestacker-1.0.4.post2/src/shinestacker/_version.py +0 -1
  43. shinestacker-1.0.4.post2/src/shinestacker/algorithms/balance.py +0 -416
  44. shinestacker-1.0.4.post2/src/shinestacker/algorithms/utils.py +0 -126
  45. shinestacker-1.0.4.post2/src/shinestacker/gui/action_config_dialog.py +0 -567
  46. shinestacker-1.0.4.post2/src/shinestacker/gui/base_form_dialog.py +0 -18
  47. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.coveragerc +0 -0
  48. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.flake8 +0 -0
  49. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.github/workflows/ci-multiplatform.yml +0 -0
  50. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.github/workflows/pylint.yml +0 -0
  51. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.github/workflows/pypi-publish.yml +0 -0
  52. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.github/workflows/release.yml +0 -0
  53. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.gitignore +0 -0
  54. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.pylintrc +0 -0
  55. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/.readthedocs.yaml +0 -0
  56. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/LICENSE +0 -0
  57. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/MANIFEST.in +0 -0
  58. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/THIRD_PARTY_LICENSES.txt +0 -0
  59. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/api.md +0 -0
  60. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/conf.py +0 -0
  61. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/gui.md +0 -0
  62. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/index.md +0 -0
  63. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/job.md +0 -0
  64. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/multilayer.md +0 -0
  65. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/noise.md +0 -0
  66. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/docs/requirements.txt +0 -0
  67. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/coffee.gif +0 -0
  68. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/coffee_stack.jpg +0 -0
  69. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/extreme-vignetting.jpg +0 -0
  70. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/flies.gif +0 -0
  71. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/flies_stack.jpg +0 -0
  72. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/flow-diagram.png +0 -0
  73. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/gui-finder.png +0 -0
  74. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/gui-project-new.png +0 -0
  75. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/gui-project-run.png +0 -0
  76. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/img/gui-retouch.png +0 -0
  77. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/pyproject.toml +0 -0
  78. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/requirements.txt +0 -0
  79. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/scripts/build_release.py +0 -0
  80. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/scripts/git-rev-list.sh +0 -0
  81. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/scripts/validate-tomli.py +0 -0
  82. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/setup.cfg +0 -0
  83. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/__init__.py +0 -0
  84. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/denoise.py +0 -0
  85. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/exif.py +0 -0
  86. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/sharpen.py +0 -0
  87. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/algorithms/white_balance.py +0 -0
  88. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/app/__init__.py +0 -0
  89. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/app/about_dialog.py +0 -0
  90. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/app/gui_utils.py +0 -0
  91. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/app/help_menu.py +0 -0
  92. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/app/main.py +0 -0
  93. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/app/open_frames.py +0 -0
  94. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/app/project.py +0 -0
  95. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/app/retouch.py +0 -0
  96. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/config/__init__.py +0 -0
  97. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/config/config.py +0 -0
  98. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/config/gui_constants.py +0 -0
  99. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/core/__init__.py +0 -0
  100. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/core/colors.py +0 -0
  101. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/core/core_utils.py +0 -0
  102. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/core/exceptions.py +0 -0
  103. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/core/framework.py +0 -0
  104. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/core/logging.py +0 -0
  105. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/__init__.py +0 -0
  106. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/colors.py +0 -0
  107. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/gui_images.py +0 -0
  108. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/gui_logging.py +0 -0
  109. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/ico/focus_stack_bkg.png +0 -0
  110. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/ico/shinestacker.icns +0 -0
  111. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/ico/shinestacker.ico +0 -0
  112. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/ico/shinestacker.png +0 -0
  113. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/ico/shinestacker.svg +0 -0
  114. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/img/close-round-line-icon.png +0 -0
  115. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/img/forward-button-icon.png +0 -0
  116. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/img/play-button-round-icon.png +0 -0
  117. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/img/plus-round-line-icon.png +0 -0
  118. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/project_model.py +0 -0
  119. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/select_path_widget.py +0 -0
  120. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/gui/tab_widget.py +0 -0
  121. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/__init__.py +0 -0
  122. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/base_filter.py +0 -0
  123. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/brush.py +0 -0
  124. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/brush_gradient.py +0 -0
  125. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/brush_preview.py +0 -0
  126. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/brush_tool.py +0 -0
  127. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/denoise_filter.py +0 -0
  128. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/display_manager.py +0 -0
  129. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/file_loader.py +0 -0
  130. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/filter_manager.py +0 -0
  131. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/icon_container.py +0 -0
  132. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/image_editor_ui.py +0 -0
  133. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/image_viewer.py +0 -0
  134. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/io_gui_handler.py +0 -0
  135. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/io_manager.py +0 -0
  136. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/layer_collection.py +0 -0
  137. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/undo_manager.py +0 -0
  138. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/unsharp_mask_filter.py +0 -0
  139. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker/retouch/white_balance_filter.py +0 -0
  140. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker.egg-info/dependency_links.txt +0 -0
  141. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker.egg-info/entry_points.txt +0 -0
  142. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker.egg-info/requires.txt +0 -0
  143. {shinestacker-1.0.4.post2 → shinestacker-1.2.0}/src/shinestacker.egg-info/top_level.txt +0 -0
@@ -2,7 +2,37 @@
2
2
 
3
3
  This page reports the main releases only and the main changes therein.
4
4
 
5
- ## [v-.-.-] - 2025-08-26
5
+ ## [v1.2.0] - 2025-08-31
6
+ **Improved pyramid algorithm**
7
+
8
+ * Implemented parallel processing for pyramid stacking algorithm
9
+ * optimized Pyramid algorithm: now a single algorithm selects automatically the best strategy ensuring that all the processing stays approximately within a given memory budget; This avoids memory issues in case many pictures are selected. Explicit configuration is also possible for specific needs.
10
+ * Implemented automatic subsample option for alignment, balancing and vignetting, now default.
11
+ * HLS and HSV corrections now supported for 16 bit images
12
+ * Added luminosity correction in the LAB color space
13
+ * Alignment module skips frames if transformation parameters are out of a reasonable ranges
14
+ * Multilayer modules sends a warning if the estimated file size is > 1GB
15
+ * "Run all jobs" action is enabled only if more than one job are present.
16
+ * Updated default module names for "new project" dialog.
17
+ * Code refactoring.
18
+ * Some GUI fixes.
19
+
20
+ ---
21
+
22
+ ## [v1.1.0] - 2025-08-28
23
+ **New Pyramids algorithm, some improvements and more fixes**
24
+
25
+ ### Changes
26
+
27
+ * added Pyramids Tiles, that requires less RAM by fusing images in tiles
28
+ * the alignment module now tolerates images of different shapes
29
+ * noisy pixel mask verifies that the mask has the same shape as input images
30
+ * minor changes to default alignment parameters
31
+ * some improvements to the GUI
32
+ * some bug fixes
33
+ ---
34
+
35
+ ## [v1.0.4.pre2] - 2025-08-26
6
36
  **Bug fixes**
7
37
 
8
38
  ### Changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shinestacker
3
- Version: 1.0.4.post2
3
+ Version: 1.2.0
4
4
  Summary: ShineStacker
5
5
  Author-email: Luca Lista <luka.lista@gmail.com>
6
6
  License-Expression: LGPL-3.0
@@ -69,6 +69,25 @@ The GUI has two main working areas:
69
69
 
70
70
  <img src='https://raw.githubusercontent.com/lucalista/shinestacker/main/img/gui-retouch.png' width="600" referrerpolicy="no-referrer">
71
71
 
72
+ # Note for macOS users
73
+
74
+ **The following note is only relevant if you download the application as compressed archive from the [release page](https://github.com/lucalista/shinestacker/releases).**
75
+
76
+ The macOS system security protection prevent to run applications downloaded from the web that come from developers that don't hold an Apple Developer Certificate.
77
+
78
+ In order to prevent this, follow the instructions below:
79
+
80
+ 1. Download the compressed archive ```shinestacker-macos.tar.gz``` in your ```Download``` folder.
81
+ 2. Double-click the archive to uncompress it. You will find a new folder ```shinestacker```.
82
+ 3. Open a terminal (*Applications > Utilities > Terminal*)
83
+ 4. Type the folliwng command on the terminal:
84
+ ```bash
85
+ xattr -cr ~/Downloads/shinestacker/shinestacker.app
86
+ ```
87
+ 5. Now you can double-click the Sine Stacker icon app in the ```shiestacker``` folder and it should run.
88
+
89
+ macOS adds a quarantine flag to all files downloaded from the internet. The above command removes that flag while preserving all other application functionality.
90
+
72
91
  # Resources
73
92
 
74
93
  🌍 [Website on WordPress](https://shinestacker.wordpress.com) • 📖 [Main documentation](https://shinestacker.readthedocs.io) • 📝 [Changelog](https://github.com/lucalista/shinestacker/blob/main/CHANGELOG.md)
@@ -38,6 +38,25 @@ The GUI has two main working areas:
38
38
 
39
39
  <img src='https://raw.githubusercontent.com/lucalista/shinestacker/main/img/gui-retouch.png' width="600" referrerpolicy="no-referrer">
40
40
 
41
+ # Note for macOS users
42
+
43
+ **The following note is only relevant if you download the application as compressed archive from the [release page](https://github.com/lucalista/shinestacker/releases).**
44
+
45
+ The macOS system security protection prevent to run applications downloaded from the web that come from developers that don't hold an Apple Developer Certificate.
46
+
47
+ In order to prevent this, follow the instructions below:
48
+
49
+ 1. Download the compressed archive ```shinestacker-macos.tar.gz``` in your ```Download``` folder.
50
+ 2. Double-click the archive to uncompress it. You will find a new folder ```shinestacker```.
51
+ 3. Open a terminal (*Applications > Utilities > Terminal*)
52
+ 4. Type the folliwng command on the terminal:
53
+ ```bash
54
+ xattr -cr ~/Downloads/shinestacker/shinestacker.app
55
+ ```
56
+ 5. Now you can double-click the Sine Stacker icon app in the ```shiestacker``` folder and it should run.
57
+
58
+ macOS adds a quarantine flag to all files downloaded from the internet. The above command removes that flag while preserving all other application functionality.
59
+
41
60
  # Resources
42
61
 
43
62
  🌍 [Website on WordPress](https://shinestacker.wordpress.com) • 📖 [Main documentation](https://shinestacker.readthedocs.io) • 📝 [Changelog](https://github.com/lucalista/shinestacker/blob/main/CHANGELOG.md)
@@ -65,7 +65,7 @@ alignment_config = {
65
65
  'border_mode': constants.BORDER_REPLICATE_BLUR,
66
66
  'border_value': (0, 0, 0, 0),
67
67
  'border_blur': 50,
68
- 'subsample': 1,
68
+ 'subsample': 0,
69
69
  'fast_subsampling': False,
70
70
  'min_good_matches': 100
71
71
  }
@@ -80,7 +80,7 @@ alignment_config = {
80
80
  * ```refine_iters``` (optional, default: 100): refinement iterations. Used only if ```transform=ALIGN_RIGID```.
81
81
  * ```align_confidence``` (optional, default: 99.9): alignment algorithm confidence (%). Used only if ```transform=ALIGN_RIGID```.
82
82
  * ```max_iters``` (optional, default: 2000): maximum number of iterations. Used only if ```transform=ALIGN_HOMOGRAPHY```.
83
- * ```subsample``` (optional, default: 1): subsample image for faster alignment. Faster, but alignment could be less accurate. It can save time, in particular for large images.
83
+ * ```subsample``` (optional, default: 0=automatic): subsample image for faster alignment. Faster, but alignment could be less accurate if only a small portion of the image is focused. It can save time, in particular for large images.
84
84
  * ```fast_subsampling``` (optional, default: ```False```): perform fast image subsampling without interpolation. Used if ```subsample``` is set to ```True```.
85
85
  * ```min_good_matches``` (optional, default: 100): if ```subsample```>1 and the number of good matches is below ```min_good_matches```, the alignment is retried without subsampling. This improbes robustness in case a too large subsampling factor is specified.
86
86
  * ```border_mode``` (optional, default: ```BORDER_REPLICATE_BLUR```): border mode. See [Adding borders to your images](https://docs.opencv.org/3.4/dc/da3/tutorial_copyMakeBorder.html) for more details. Possible values are:
@@ -5,7 +5,12 @@ job.add_action(Actions("balance", [BalanceFrames(*options)])
5
5
  ```
6
6
 
7
7
  Arguments for the constructor of ```BalanceFrames``` are:
8
- *```channel``` (optional, default: BALANCE_LUMI): channels to be balanced. Possible values are: ```BALANCE_LUMI``` (default): balance equally for R, G and B channels, should be reasonably fine for most of the cases; ```BALANCE_RGB```: balance luminosity separately for R, G and B channels, it may be needed if some but not all of the images have a undesired color dominance; ```BALANCE_HSV```: balance saturation a luminosity value in the HSV (Hue, Saturation, brightness Value) representation, it may be needed in cases of extreme luminosity variation that affects saturation; ```BALANCE_HLS```: balance saturation a luminosity value in the HLS (Hue, Lightness, Saturation) representation, it may be needed in cases of extreme luminosity variation that affects saturation. Note that ```BALANCE_HSV``` and ```BALANCE_HLS``` are only supported for 8-bit images.
8
+ * ```channel``` (optional, default: BALANCE_LUMI): channels to be balanced. Possible values are:
9
+ - ```BALANCE_LUMI``` (default): balance equally for R, G and B channels, should be reasonably fine for most of the cases;
10
+ - ```BALANCE_RGB```: balance luminosity separately for R, G and B channels, it may be needed if some but not all of the images have a undesired color dominance;
11
+ - ```BALANCE_HSV```: balance saturation and luminosity value in the HSV (Hue, Saturation, brightness Value) color space, it may be needed in cases of extreme luminosity variation that affects saturation;
12
+ - ```BALANCE_HLS```: balance saturation and luminosity value in the HLS (Hue, Lightness, Saturation) color space, it may be needed in cases of extreme luminosity variation that affects saturation;
13
+ - ```BALANCE_LAB```: balance luminosity in the LAB color space.
9
14
  * ```mask_size``` (optional): if specified, luminosity and color balance is only applied to pixels within a circle of radius equal to the minimum between the image width and height times ```mask_size```, i.e: 0.8 means 80% of a portrait image width or landscape image height. It may beuseful for images with vignetting, in order to avoid including in the balance processing the outer darker pixels.
10
15
  * ```intensity_interval``` (optional): if specifies, only pixels with intensity within the specified range are used. It may be useful to remove very dark areas or very light areas. Not used if ```MATCH_HIST``` is specified as value for ```corr_map```. The argument has to be a dictionary where one or both values corresponding to the keys ```min``` and ```max``` can be specified. The default values are:
11
16
  ```python
@@ -15,7 +20,7 @@ intensity_interval = {
15
20
  }
16
21
  ```
17
22
  Note that for 8-bit images the maximum intensity is 255, while for 16-bit images the maximum intensity is 65536.
18
- * ```subsample``` (optional, default: 8): extracts intensity histogram using every n-th pixel in each dimension in order to reduce processing time. By default, it takes one every 8 pixels in horizontal and vertical directions, i.e.: one every 100 pixels in total. This option is not ised if ```corr_map``` is equal to ```BALANCE_MATCH_HIST```.
23
+ * ```subsample``` (optional, default: 0=automatic): extracts intensity histogram using every n-th pixel in each dimension in order to reduce processing time. This option is not ised if ```corr_map``` is equal to ```BALANCE_MATCH_HIST```.
19
24
  * ```fast_subsampling``` (optional, default: ```False```): perform fast image subsampling without interpolation. Used if ```subsample``` is set to ```True```.
20
25
  * ```corr_map``` (optional, default: ```BALANCE_LINEAR```, possible values: ```BALANCE_LINEAR```, ```BALANCE_GAMMA``` and ```MATCH_HIST```): specifies the type of intensity correction.
21
26
  * ```BALANCE_LINEAR```: a linear correction is applied in order to balance the average intensity of the corrected images to the reference image in the specified channels.
@@ -34,7 +34,7 @@ Arguments for the constructor of ```FocusStackBunch``` are:
34
34
 
35
35
  ## Stack algorithms
36
36
 
37
- ```PyramidStack```, Laplacian pyramid focus stacking algorithm, optimized implementation
37
+ ```PyramidStack```, Laplacian pyramid focus stacking algorithm
38
38
 
39
39
  Arguments for the constructor are:
40
40
  * ```pyramid_min_size``` (optional, default: 32)
@@ -42,6 +42,24 @@ Arguments for the constructor are:
42
42
  * ```gen_kernel``` (optional, default: 0.4)
43
43
  * ```float_type``` (optional, default: ```FLOAT_32```, possible values: ```FLOAT_32```, ```FLOAT_64```): precision for internal image representation
44
44
 
45
+ ```PyramidTilesStack```, pyramid algorithn with I/O buffered tile pyramid merging to optimize memory usage for large files
46
+
47
+ Arguments for the constructor are, in addition to the ones for ```PyramidStack```:
48
+ * ```tile_size``` (optional, default: 512): size of a time
49
+ * ```n_tiled_layers``` (optional, default: 2): number of layers that are tiled. Usually the last one or two are the ones that take more memory.
50
+ * ```max_threads``` (optional, default: number of cores, up to a maximum of 8): maximum number of thread used for parallel processing. The actual number of threads does not exceed the number of available cores.
51
+
52
+
53
+ ```PyramidAutoStack```, pyramid algorithn with capability to automatically switch from all-in-memory to I/O buffered tiled.
54
+
55
+ Arguments for the constructor are, in addition to the ones for ```PyramidTilesStack```:
56
+ * ```mode``` (optional, default: ```auto```): can be ```auto```, ```memory``` or ```tiled```.
57
+ * ```memory_limit``` (optional, default: 8×1024<sup>3</sup>sup>): memory limit to determine optimal running parameters
58
+
59
+
60
+ Arguments for the constructor are the same ad for ```PyramidStack``` plus:
61
+ * ```tile_size``` (optional, default: 512): size of the tile used for partial image merging
62
+
45
63
  ```DepthMapStack```, Depth map focus stacking algorithm
46
64
 
47
65
  Arguments for the constructor are:
@@ -103,6 +103,5 @@ pip install ipywidgets
103
103
 
104
104
  | Issue | Workaround |
105
105
  |----------|----------------|
106
- | Balance modes ```HSV```/```HLS``` don't support 16-bit images | convert to 8-bit or use ```RGB``` or luminosity |
107
- | PNG support untested | Convert to TIFF/JPEG first |
108
- | GUI tests limited | Report bugs as GitHub issuse |
106
+ | PNG and RAW unsupported | Convert to TIFF/JPEG first |
107
+ | GUI tests limited | Report any bugs as GitHub issuse |
@@ -14,6 +14,7 @@ Arguments for the constructor of ```Vignetting``` are:
14
14
  * ```r_steps``` (optional, default: 100): number of radial steps to determine mean pixel luminosity.
15
15
  * ```black_threshold``` (optional, default: 1): apply correction only on pixels with luminosity greater than.
16
16
  * ```max_correction``` (optional, default: 1): if less than one, the correction is rescaled in order to be at most the specified valye.
17
+ * ```subsample``` (optional, default: 0=automatic): extracts intensity histogram using every n-th pixel in each dimension in order to reduce processing time.
17
18
  * ```plot_correction``` (optional, default: ```False```): if ```True```, plot vignetting correction curve for each frame.
18
19
  * ```plot_summary``` (optional, default: ```False```): if ```True```, plot a summary histogram with the vignetting correction levels.
19
20
  * ```enabled``` (optional, default: ```True```): allows to switch on and off this module.
@@ -0,0 +1 @@
1
+ __version__ = '1.2.0'
@@ -8,6 +8,8 @@ from .balance import BalanceFrames
8
8
  from .stack import FocusStackBunch, FocusStack
9
9
  from .depth_map import DepthMapStack
10
10
  from .pyramid import PyramidStack
11
+ from .pyramid_tiles import PyramidTilesStack
12
+ from .pyramid_auto import PyramidAutoStack
11
13
  from .multilayer import MultiLayer
12
14
  from .noise_detection import NoiseDetection, MaskNoise
13
15
  from .vignetting import Vignetting
@@ -16,5 +18,6 @@ logger.addHandler(logging.NullHandler())
16
18
 
17
19
  __all__ = [
18
20
  'StackJob', 'CombinedActions', 'AlignFrames', 'BalanceFrames', 'FocusStackBunch', 'FocusStack',
19
- 'DepthMapStack', 'PyramidStack', 'MultiLayer', 'NoiseDetection', 'MaskNoise', 'Vignetting'
21
+ 'DepthMapStack', 'PyramidStack', 'PyramidTilesStack', 'PyramidAutoStack', 'MultiLayer',
22
+ 'NoiseDetection', 'MaskNoise', 'Vignetting'
20
23
  ]
@@ -1,12 +1,13 @@
1
- # pylint: disable=C0114, C0115, C0116, E1101, R0914, R0913, R0917, R0912, R0915, R0902
1
+ # pylint: disable=C0114, C0115, C0116, E1101, R0914, R0913, R0917, R0912, R0915, R0902, E1121, W0102
2
2
  import logging
3
+ import math
3
4
  import numpy as np
4
5
  import matplotlib.pyplot as plt
5
6
  import cv2
6
7
  from .. config.constants import constants
7
8
  from .. core.exceptions import AlignmentError, InvalidOptionError
8
9
  from .. core.colors import color_str
9
- from .utils import img_8bit, img_bw_8bit, save_plot, get_img_metadata, validate_image, img_subsample
10
+ from .utils import img_8bit, img_bw_8bit, save_plot, img_subsample
10
11
  from .stack_framework import SubAction
11
12
 
12
13
  _DEFAULT_FEATURE_CONFIG = {
@@ -29,6 +30,7 @@ _DEFAULT_ALIGNMENT_CONFIG = {
29
30
  'refine_iters': constants.DEFAULT_REFINE_ITERS,
30
31
  'align_confidence': constants.DEFAULT_ALIGN_CONFIDENCE,
31
32
  'max_iters': constants.DEFAULT_ALIGN_MAX_ITERS,
33
+ 'abort_abnormal': constants.DEFAULT_ALIGN_ABORT_ABNORMAL,
32
34
  'border_mode': constants.DEFAULT_BORDER_MODE,
33
35
  'border_value': constants.DEFAULT_BORDER_VALUE,
34
36
  'border_blur': constants.DEFAULT_BORDER_BLUR,
@@ -44,6 +46,89 @@ _cv2_border_mode_map = {
44
46
  constants.BORDER_REPLICATE_BLUR: cv2.BORDER_REPLICATE
45
47
  }
46
48
 
49
+ _AFFINE_THRESHOLDS = {
50
+ 'max_rotation': 10.0, # degrees
51
+ 'min_scale': 0.9,
52
+ 'max_scale': 1.1,
53
+ 'max_shear': 5.0, # degrees
54
+ 'max_translation_ratio': 0.1, # 10% of image dimension
55
+ }
56
+
57
+ _HOMOGRAPHY_THRESHOLDS = {
58
+ 'max_skew': 10.0, # degrees
59
+ 'max_scale_change': 1.5, # max area change ratio
60
+ 'max_aspect_ratio': 2.0, # max aspect ratio change
61
+ }
62
+
63
+
64
+ def decompose_affine_matrix(m):
65
+ a, b, tx = m[0, 0], m[0, 1], m[0, 2]
66
+ c, d, ty = m[1, 0], m[1, 1], m[1, 2]
67
+ scale_x = math.sqrt(a**2 + b**2)
68
+ scale_y = math.sqrt(c**2 + d**2)
69
+ rotation = math.degrees(math.atan2(b, a))
70
+ shear = math.degrees(math.atan2(-c, d)) - rotation
71
+ shear = (shear + 180) % 360 - 180
72
+ return (scale_x, scale_y), rotation, shear, (tx, ty)
73
+
74
+
75
+ def check_affine_matrix(m, img_shape, affine_thresholds=_AFFINE_THRESHOLDS):
76
+ if affine_thresholds is None:
77
+ return True, "No thresholds provided"
78
+ (scale_x, scale_y), rotation, shear, (tx, ty) = decompose_affine_matrix(m)
79
+ h, w = img_shape[:2]
80
+ reasons = []
81
+ if abs(rotation) > affine_thresholds['max_rotation']:
82
+ reasons.append(f"rotation too large ({rotation:.1f}°)")
83
+ if scale_x < affine_thresholds['min_scale'] or scale_x > affine_thresholds['max_scale']:
84
+ reasons.append(f"x-scale out of range ({scale_x:.2f})")
85
+ if scale_y < affine_thresholds['min_scale'] or scale_y > affine_thresholds['max_scale']:
86
+ reasons.append(f"y-scale out of range ({scale_y:.2f})")
87
+ if abs(shear) > affine_thresholds['max_shear']:
88
+ reasons.append(f"shear too large ({shear:.1f}°)")
89
+ max_tx = w * affine_thresholds['max_translation_ratio']
90
+ max_ty = h * affine_thresholds['max_translation_ratio']
91
+ if abs(tx) > max_tx:
92
+ reasons.append(f"x-translation too large (|{tx:.1f}| > {max_tx:.1f})")
93
+ if abs(ty) > max_ty:
94
+ reasons.append(f"y-translation too large (|{ty:.1f}| > {max_ty:.1f})")
95
+ if reasons:
96
+ return False, "; ".join(reasons)
97
+ return True, "Transformation within acceptable limits"
98
+
99
+
100
+ def check_homography_distortion(m, img_shape, homography_thresholds=_HOMOGRAPHY_THRESHOLDS):
101
+ if homography_thresholds is None:
102
+ return True, "No thresholds provided"
103
+ h, w = img_shape[:2]
104
+ corners = np.array([[0, 0], [w, 0], [w, h], [0, h]], dtype=np.float32)
105
+ transformed = cv2.perspectiveTransform(corners.reshape(1, -1, 2), m).reshape(-1, 2)
106
+ reasons = []
107
+ area_orig = w * h
108
+ area_new = cv2.contourArea(transformed)
109
+ area_ratio = area_new / area_orig
110
+ if area_ratio > homography_thresholds['max_scale_change'] or \
111
+ area_ratio < 1.0 / homography_thresholds['max_scale_change']:
112
+ reasons.append(f"area change too large ({area_ratio:.2f})")
113
+ rect = cv2.minAreaRect(transformed.astype(np.float32))
114
+ (w_rect, h_rect) = rect[1]
115
+ aspect_ratio = max(w_rect, h_rect) / min(w_rect, h_rect)
116
+ if aspect_ratio > homography_thresholds['max_aspect_ratio']:
117
+ reasons.append(f"aspect ratio change too large ({aspect_ratio:.2f})")
118
+ angles = []
119
+ for i in range(4):
120
+ vec1 = transformed[(i + 1) % 4] - transformed[i]
121
+ vec2 = transformed[(i - 1) % 4] - transformed[i]
122
+ angle = np.degrees(np.arccos(np.dot(vec1, vec2) /
123
+ (np.linalg.norm(vec1) * np.linalg.norm(vec2))))
124
+ angles.append(angle)
125
+ max_angle_dev = max(abs(angle - 90) for angle in angles)
126
+ if max_angle_dev > homography_thresholds['max_skew']:
127
+ reasons.append(f"angle distortion too large ({max_angle_dev:.1f}°)")
128
+ if reasons:
129
+ return False, "; ".join(reasons)
130
+ return True, "Transformation within acceptable limits"
131
+
47
132
 
48
133
  def get_good_matches(des_0, des_1, matching_config=None):
49
134
  matching_config = {**_DEFAULT_MATCHING_CONFIG, **(matching_config or {})}
@@ -152,7 +237,9 @@ def find_transform(src_pts, dst_pts, transform=constants.DEFAULT_TRANSFORM,
152
237
 
153
238
 
154
239
  def align_images(img_1, img_0, feature_config=None, matching_config=None, alignment_config=None,
155
- plot_path=None, callbacks=None):
240
+ plot_path=None, callbacks=None,
241
+ affine_thresholds=_AFFINE_THRESHOLDS,
242
+ homography_thresholds=_HOMOGRAPHY_THRESHOLDS):
156
243
  feature_config = {**_DEFAULT_FEATURE_CONFIG, **(feature_config or {})}
157
244
  matching_config = {**_DEFAULT_MATCHING_CONFIG, **(matching_config or {})}
158
245
  alignment_config = {**_DEFAULT_ALIGNMENT_CONFIG, **(alignment_config or {})}
@@ -161,10 +248,15 @@ def align_images(img_1, img_0, feature_config=None, matching_config=None, alignm
161
248
  except KeyError as e:
162
249
  raise InvalidOptionError("border_mode", alignment_config['border_mode']) from e
163
250
  min_matches = 4 if alignment_config['transform'] == constants.ALIGN_HOMOGRAPHY else 3
164
- validate_image(img_0, *get_img_metadata(img_1))
165
251
  if callbacks and 'message' in callbacks:
166
252
  callbacks['message']()
253
+ h_ref, w_ref = img_1.shape[:2]
254
+ h0, w0 = img_0.shape[:2]
167
255
  subsample = alignment_config['subsample']
256
+ if subsample == 0:
257
+ img_res = (float(h0) / 1000) * (float(w0) / 1000)
258
+ target_res = constants.DEFAULT_ALIGN_RES_TARGET_MPX
259
+ subsample = int(1 + math.floor(img_res / target_res))
168
260
  fast_subsampling = alignment_config['fast_subsampling']
169
261
  min_good_matches = alignment_config['min_good_matches']
170
262
  while True:
@@ -204,15 +296,14 @@ def align_images(img_1, img_0, feature_config=None, matching_config=None, alignm
204
296
  flags=2), cv2.COLOR_BGR2RGB)
205
297
  plt.figure(figsize=(10, 5))
206
298
  plt.imshow(img_match, 'gray')
207
- plt.savefig(plot_path)
299
+ save_plot(plot_path)
208
300
  if callbacks and 'save_plot' in callbacks:
209
301
  callbacks['save_plot'](plot_path)
210
- h, w = img_0.shape[:2]
211
302
  h_sub, w_sub = img_0_sub.shape[:2]
212
303
  if subsample > 1:
213
304
  if transform == constants.ALIGN_HOMOGRAPHY:
214
305
  low_size = np.float32([[0, 0], [0, h_sub], [w_sub, h_sub], [w_sub, 0]])
215
- high_size = np.float32([[0, 0], [0, h], [w, h], [w, 0]])
306
+ high_size = np.float32([[0, 0], [0, h0], [w0, h0], [w0, 0]])
216
307
  scale_up = cv2.getPerspectiveTransform(low_size, high_size)
217
308
  scale_down = cv2.getPerspectiveTransform(high_size, low_size)
218
309
  m = scale_up @ m @ scale_down
@@ -225,22 +316,37 @@ def align_images(img_1, img_0, feature_config=None, matching_config=None, alignm
225
316
  m[:, 2] = translation_fullres
226
317
  else:
227
318
  raise InvalidOptionError("transform", transform)
319
+
320
+ transform_type = alignment_config['transform']
321
+ is_valid = True
322
+ reason = ""
323
+ if transform_type == constants.ALIGN_RIGID:
324
+ is_valid, reason = check_affine_matrix(
325
+ m, img_0.shape, affine_thresholds)
326
+ elif transform_type == constants.ALIGN_HOMOGRAPHY:
327
+ is_valid, reason = check_homography_distortion(
328
+ m, img_0.shape, homography_thresholds)
329
+ if not is_valid:
330
+ if callbacks and 'warning' in callbacks:
331
+ callbacks['warning'](f"invalid transformation: {reason}")
332
+ return n_good_matches, None, None
333
+
228
334
  if callbacks and 'align_message' in callbacks:
229
335
  callbacks['align_message']()
230
336
  img_mask = np.ones_like(img_0, dtype=np.uint8)
231
337
  if alignment_config['transform'] == constants.ALIGN_HOMOGRAPHY:
232
338
  img_warp = cv2.warpPerspective(
233
- img_0, m, (w, h),
339
+ img_0, m, (w_ref, h_ref),
234
340
  borderMode=cv2_border_mode, borderValue=alignment_config['border_value'])
235
341
  if alignment_config['border_mode'] == constants.BORDER_REPLICATE_BLUR:
236
- mask = cv2.warpPerspective(img_mask, m, (w, h),
342
+ mask = cv2.warpPerspective(img_mask, m, (w_ref, h_ref),
237
343
  borderMode=cv2.BORDER_CONSTANT, borderValue=0)
238
344
  elif alignment_config['transform'] == constants.ALIGN_RIGID:
239
345
  img_warp = cv2.warpAffine(
240
- img_0, m, (w, h),
346
+ img_0, m, (w_ref, h_ref),
241
347
  borderMode=cv2_border_mode, borderValue=alignment_config['border_value'])
242
348
  if alignment_config['border_mode'] == constants.BORDER_REPLICATE_BLUR:
243
- mask = cv2.warpAffine(img_mask, m, (w, h),
349
+ mask = cv2.warpAffine(img_mask, m, (w_ref, h_ref),
244
350
  borderMode=cv2.BORDER_CONSTANT, borderValue=0)
245
351
  if alignment_config['border_mode'] == constants.BORDER_REPLICATE_BLUR:
246
352
  if callbacks and 'blur_message' in callbacks:
@@ -293,7 +399,7 @@ class AlignFrames(SubAction):
293
399
  'ecc_message': lambda: self.sub_msg(": ecc refinement"),
294
400
  'blur_message': lambda: self.sub_msg(': blur borders'),
295
401
  'warning': lambda msg: self.sub_msg(
296
- f': {msg}', constants.LOG_COLOR_ALERT),
402
+ f': {msg}', constants.LOG_COLOR_WARNING),
297
403
  'save_plot': lambda plot_path: self.process.callback(
298
404
  'save_plot', self.process.id,
299
405
  f"{self.process.name}: matches\nframe {idx_str}", plot_path)
@@ -303,19 +409,27 @@ class AlignFrames(SubAction):
303
409
  f"{self.process.name}-matches-{idx_str}.pdf"
304
410
  else:
305
411
  plot_path = None
412
+ if self.alignment_config['abort_abnormal']:
413
+ affine_thresholds = _AFFINE_THRESHOLDS
414
+ homography_thresholds = _HOMOGRAPHY_THRESHOLDS
415
+ else:
416
+ affine_thresholds = None
417
+ homography_thresholds = None
306
418
  n_good_matches, _m, img = align_images(
307
419
  img_1, img_0,
308
420
  feature_config=self.feature_config,
309
421
  matching_config=self.matching_config,
310
422
  alignment_config=self.alignment_config,
311
423
  plot_path=plot_path,
312
- callbacks=callbacks
424
+ callbacks=callbacks,
425
+ affine_thresholds=affine_thresholds,
426
+ homography_thresholds=homography_thresholds
313
427
  )
314
428
  self.n_matches[idx] = n_good_matches
315
429
  if n_good_matches < self.min_matches:
316
430
  self.process.sub_message(f": image not aligned, too few matches found: "
317
431
  f"{n_good_matches}", level=logging.CRITICAL)
318
- raise AlignmentError(idx, f"too few matches found: "
432
+ raise AlignmentError(idx, f"Image not aligned, too few matches found: "
319
433
  f"{n_good_matches} < {self.min_matches}")
320
434
  return img
321
435