openfocus 1.76.0__tar.gz → 2.0.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.
- {openfocus-1.76.0 → openfocus-2.0.0}/PKG-INFO +85 -25
- {openfocus-1.76.0 → openfocus-2.0.0}/README.md +79 -23
- openfocus-2.0.0/build_identity.py +2 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/constants.py +14 -1
- openfocus-2.0.0/core/_alignment_kernels.py +204 -0
- openfocus-2.0.0/core/_background_focus_gpu.py +135 -0
- openfocus-2.0.0/core/_ecc_area_gpu.py +213 -0
- openfocus-2.0.0/core/accelerator_win64.json +83 -0
- openfocus-2.0.0/core/algorithm_adapters.py +199 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/algorithms.py +433 -339
- openfocus-2.0.0/core/aligned_previews.py +122 -0
- openfocus-2.0.0/core/app.py +310 -0
- openfocus-2.0.0/core/background_fill.py +1788 -0
- openfocus-2.0.0/core/batch_converter.py +914 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/cli.py +1124 -168
- {openfocus-1.76.0 → openfocus-2.0.0}/core/compare_worker.py +127 -21
- {openfocus-1.76.0 → openfocus-2.0.0}/core/control/client.py +15 -6
- {openfocus-1.76.0 → openfocus-2.0.0}/core/control/protocol.py +5 -2
- {openfocus-1.76.0 → openfocus-2.0.0}/core/control/server.py +1870 -1711
- {openfocus-1.76.0 → openfocus-2.0.0}/core/depth_map.py +30 -17
- openfocus-2.0.0/core/experimental.py +15 -0
- openfocus-2.0.0/core/focus_order.py +198 -0
- openfocus-2.0.0/core/frame_resolution_cache.py +551 -0
- openfocus-2.0.0/core/frame_storage.py +1069 -0
- openfocus-2.0.0/core/frame_transport.py +187 -0
- openfocus-2.0.0/core/fusion_diagnostics.py +23 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/grouped_fusion.py +44 -11
- {openfocus-1.76.0 → openfocus-2.0.0}/core/image_loader.py +571 -160
- openfocus-2.0.0/core/inference_pack.py +367 -0
- openfocus-2.0.0/core/inference_process.py +45 -0
- openfocus-2.0.0/core/inference_tensorrt.py +303 -0
- openfocus-2.0.0/core/inference_worker.py +190 -0
- openfocus-2.0.0/core/mosaic.py +1287 -0
- openfocus-2.0.0/core/mosaic_blend.py +146 -0
- openfocus-2.0.0/core/mosaic_control.py +489 -0
- openfocus-2.0.0/core/mosaic_hdr.py +402 -0
- openfocus-2.0.0/core/mosaic_photo.py +515 -0
- openfocus-2.0.0/core/mosaic_projection.py +597 -0
- openfocus-2.0.0/core/mosaic_seam.py +292 -0
- openfocus-2.0.0/core/mosaic_stitcher.py +475 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/multi_focus_fusion.py +809 -265
- openfocus-2.0.0/core/openfocus_alignment.py +1252 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/recipes.py +98 -16
- {openfocus-1.76.0 → openfocus-2.0.0}/core/registration.py +767 -516
- openfocus-2.0.0/core/registration_errors.py +19 -0
- openfocus-2.0.0/core/render_context.py +533 -0
- openfocus-2.0.0/core/render_preflight.py +198 -0
- openfocus-2.0.0/core/render_process.py +544 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/resource_policy.py +350 -41
- openfocus-2.0.0/core/scratch_registry.py +505 -0
- openfocus-2.0.0/core/source_frames.py +1733 -0
- openfocus-2.0.0/core/source_previews.py +445 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/stack_review.py +6 -1
- openfocus-2.0.0/core/storage_preflight.py +51 -0
- openfocus-2.0.0/core/windows_shell.py +199 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/workers.py +796 -210
- {openfocus-1.76.0 → openfocus-2.0.0}/docs/THIRD_PARTY_NOTICES.md +67 -0
- openfocus-2.0.0/fusion_methods/_dct_kernels.py +182 -0
- openfocus-2.0.0/fusion_methods/_depth_kernel.py +186 -0
- openfocus-2.0.0/fusion_methods/_dtcwt_kernels.py +48 -0
- openfocus-2.0.0/fusion_methods/_gff_kernels.py +467 -0
- openfocus-2.0.0/fusion_methods/_gfg_kernels.py +604 -0
- openfocus-2.0.0/fusion_methods/_openfocus_depth_rows.py +178 -0
- openfocus-2.0.0/fusion_methods/_openfocus_execution.py +236 -0
- openfocus-2.0.0/fusion_methods/_openfocus_gpu.py +1130 -0
- openfocus-2.0.0/fusion_methods/_openfocus_gpu_a.py +512 -0
- openfocus-2.0.0/fusion_methods/_openfocus_gpu_c.py +471 -0
- openfocus-2.0.0/fusion_methods/_openfocus_gpu_dct.py +527 -0
- openfocus-2.0.0/fusion_methods/_openfocus_gpu_dtcwt.py +1743 -0
- openfocus-2.0.0/fusion_methods/_openfocus_gpu_gff.py +896 -0
- openfocus-2.0.0/fusion_methods/_openfocus_gpu_gfg.py +984 -0
- openfocus-2.0.0/fusion_methods/_openfocus_kernels.py +285 -0
- openfocus-2.0.0/fusion_methods/_openfocus_pixels.py +126 -0
- openfocus-2.0.0/fusion_methods/_openfocus_pyramid.py +270 -0
- openfocus-2.0.0/fusion_methods/_openfocus_resample.py +316 -0
- openfocus-2.0.0/fusion_methods/dct.py +380 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/fusion_methods/dtcwt.py +539 -510
- openfocus-2.0.0/fusion_methods/gff.py +363 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/fusion_methods/gfg_fgf.py +280 -127
- openfocus-2.0.0/fusion_methods/inference_client.py +152 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/fusion_methods/neural_common.py +88 -43
- openfocus-2.0.0/fusion_methods/neural_runtime.py +815 -0
- openfocus-2.0.0/fusion_methods/openfocus_a.py +420 -0
- openfocus-2.0.0/fusion_methods/openfocus_ab.py +303 -0
- openfocus-2.0.0/fusion_methods/openfocus_bc.py +277 -0
- openfocus-2.0.0/fusion_methods/openfocus_depth.py +413 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/fusion_methods/stackmff_v1.py +9 -12
- {openfocus-1.76.0 → openfocus-2.0.0}/fusion_methods/stackmff_v2.py +49 -35
- openfocus-2.0.0/fusion_methods/stackmff_v2_tiled.py +301 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/fusion_methods/stackmffv3.py +61 -76
- openfocus-2.0.0/locales/__init__.py +426 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/_extra.py +1180 -82
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/de.py +590 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/en.py +594 -44
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/fr.py +590 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/it.py +590 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/ko.py +590 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/nl.py +590 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/pl.py +590 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/pt.py +590 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/ru.py +590 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/locales/zh.py +592 -42
- {openfocus-1.76.0 → openfocus-2.0.0}/openfocus.egg-info/PKG-INFO +85 -25
- {openfocus-1.76.0 → openfocus-2.0.0}/openfocus.egg-info/SOURCES.txt +181 -2
- {openfocus-1.76.0 → openfocus-2.0.0}/openfocus.egg-info/requires.txt +7 -1
- {openfocus-1.76.0 → openfocus-2.0.0}/openfocus.egg-info/top_level.txt +1 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/pyproject.toml +16 -16
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_16bit_and_cache.py +58 -4
- openfocus-2.0.0/tests/test_account_client.py +1409 -0
- openfocus-2.0.0/tests/test_account_reporting_gui.py +746 -0
- openfocus-2.0.0/tests/test_activity_logging.py +143 -0
- openfocus-2.0.0/tests/test_agent_tools.py +148 -0
- openfocus-2.0.0/tests/test_algorithm_bench.py +111 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_algorithm_surfaces.py +485 -291
- openfocus-2.0.0/tests/test_algorithms.py +352 -0
- openfocus-2.0.0/tests/test_alignment_cache_atomic.py +510 -0
- openfocus-2.0.0/tests/test_alignment_diagnostics_gui.py +27 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_app_paths.py +39 -3
- openfocus-2.0.0/tests/test_application_wheel_guard.py +162 -0
- openfocus-2.0.0/tests/test_background_fill.py +1027 -0
- openfocus-2.0.0/tests/test_background_fill_exposure.py +51 -0
- openfocus-2.0.0/tests/test_background_fill_history.py +674 -0
- openfocus-2.0.0/tests/test_background_fill_memory.py +216 -0
- openfocus-2.0.0/tests/test_background_focus_gpu.py +98 -0
- openfocus-2.0.0/tests/test_batch_converter.py +1728 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_batch_drag_drop.py +348 -13
- openfocus-2.0.0/tests/test_batch_export_contract.py +1164 -0
- openfocus-2.0.0/tests/test_bounded_image_export.py +645 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_cfa_dng.py +244 -196
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_cli.py +103 -6
- openfocus-2.0.0/tests/test_cli_engineering.py +1471 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_cli_native_raw.py +9 -22
- openfocus-2.0.0/tests/test_cli_profile.py +84 -0
- openfocus-2.0.0/tests/test_cli_storage.py +290 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_compare_canvas.py +48 -18
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_compare_dialog.py +567 -46
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_compare_worker.py +120 -17
- openfocus-2.0.0/tests/test_compiler_cache.py +42 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_control_channel.py +1144 -48
- openfocus-2.0.0/tests/test_control_text_input.py +93 -0
- openfocus-2.0.0/tests/test_converter_output_options.py +205 -0
- openfocus-2.0.0/tests/test_crash_report.py +167 -0
- openfocus-2.0.0/tests/test_dct_gpu.py +487 -0
- openfocus-2.0.0/tests/test_debug_logging.py +192 -0
- openfocus-2.0.0/tests/test_deferred_registration.py +727 -0
- openfocus-2.0.0/tests/test_depth_cache_lock.py +90 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_depth_dialog.py +302 -34
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_depth_map.py +153 -41
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_diagnostics.py +113 -5
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_display_paths.py +38 -2
- openfocus-2.0.0/tests/test_dng_display_preview.py +354 -0
- openfocus-2.0.0/tests/test_downsample_dimensions.py +268 -0
- openfocus-2.0.0/tests/test_dtcwt_gpu.py +382 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_dtcwt_parallel.py +248 -244
- openfocus-2.0.0/tests/test_ecc_area_gpu.py +111 -0
- openfocus-2.0.0/tests/test_ecc_parallel_prepare.py +419 -0
- openfocus-2.0.0/tests/test_exif_attribution.py +237 -0
- openfocus-2.0.0/tests/test_experimental_features.py +207 -0
- openfocus-2.0.0/tests/test_explorer_import.py +234 -0
- openfocus-2.0.0/tests/test_export_stackmff_publication.py +31 -0
- openfocus-2.0.0/tests/test_feather_visual_tool.py +28 -0
- openfocus-2.0.0/tests/test_file_dialogs.py +605 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_flat_field_workflow.py +109 -13
- openfocus-2.0.0/tests/test_focus_order.py +71 -0
- openfocus-2.0.0/tests/test_fonts.py +127 -0
- openfocus-2.0.0/tests/test_frame_resolution_cache.py +457 -0
- openfocus-2.0.0/tests/test_frame_storage_admission.py +762 -0
- openfocus-2.0.0/tests/test_frame_transfer.py +318 -0
- openfocus-2.0.0/tests/test_frozen_cli_smoke.py +43 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_fusion_methods.py +271 -19
- openfocus-2.0.0/tests/test_fusion_sources.py +685 -0
- openfocus-2.0.0/tests/test_gfg_fgf_gpu.py +503 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_grouped_fusion.py +92 -11
- openfocus-2.0.0/tests/test_gui_lifecycle.py +245 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_gui_units.py +572 -50
- openfocus-2.0.0/tests/test_guided_filter_gpu.py +436 -0
- openfocus-2.0.0/tests/test_help_manual.py +35 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_i18n_packs.py +74 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_icc_profiles.py +43 -11
- openfocus-2.0.0/tests/test_image_write_metadata_errors.py +137 -0
- openfocus-2.0.0/tests/test_inference_dispatch.py +191 -0
- openfocus-2.0.0/tests/test_inference_pack.py +124 -0
- openfocus-2.0.0/tests/test_input_formats.py +348 -0
- openfocus-2.0.0/tests/test_label_native_preview.py +295 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_labels.py +157 -0
- openfocus-2.0.0/tests/test_lang_ui_audit.py +121 -0
- openfocus-2.0.0/tests/test_launch_film_cleanup.py +42 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_layered_export_gui.py +142 -2
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_layered_tiff.py +37 -0
- openfocus-2.0.0/tests/test_lazy_project_consumers.py +389 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_lazy_render_workers.py +264 -128
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_linear_desktop_integration.py +106 -4
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_linear_dng.py +49 -1
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_linear_folder_load.py +42 -2
- openfocus-2.0.0/tests/test_linear_raw_selection_gui.py +269 -0
- openfocus-2.0.0/tests/test_linux_desktop_integration.py +66 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_loader_parallel.py +91 -0
- openfocus-2.0.0/tests/test_localized_release_notes.py +75 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_logging_setup.py +30 -14
- openfocus-2.0.0/tests/test_machine_preferences.py +43 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_magnifier_coordinates.py +127 -14
- openfocus-2.0.0/tests/test_memory_guard.py +354 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_menu_translations.py +87 -28
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_mesh_export.py +83 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_mosaic.py +277 -7
- openfocus-2.0.0/tests/test_mosaic_control.py +295 -0
- openfocus-2.0.0/tests/test_mosaic_editors.py +377 -0
- openfocus-2.0.0/tests/test_mosaic_hdr.py +385 -0
- openfocus-2.0.0/tests/test_mosaic_photo.py +498 -0
- openfocus-2.0.0/tests/test_mosaic_pipeline.py +333 -0
- openfocus-2.0.0/tests/test_mosaic_projection.py +412 -0
- openfocus-2.0.0/tests/test_mosaic_seam.py +189 -0
- openfocus-2.0.0/tests/test_mosaic_stitcher.py +162 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_multipage_and_recovery.py +51 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_neural_backend_admission.py +10 -2
- openfocus-2.0.0/tests/test_neural_runtime.py +1120 -0
- openfocus-2.0.0/tests/test_neural_streaming.py +280 -0
- openfocus-2.0.0/tests/test_openfocus_a_soft.py +79 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_openfocus_ab.py +352 -146
- openfocus-2.0.0/tests/test_openfocus_alignment.py +290 -0
- openfocus-2.0.0/tests/test_openfocus_band_consumers.py +179 -0
- openfocus-2.0.0/tests/test_openfocus_depth_rows.py +40 -0
- openfocus-2.0.0/tests/test_openfocus_geometry.py +22 -0
- openfocus-2.0.0/tests/test_openfocus_gpu.py +532 -0
- openfocus-2.0.0/tests/test_openfocus_native_resample.py +162 -0
- openfocus-2.0.0/tests/test_openfocus_parity.py +147 -0
- openfocus-2.0.0/tests/test_openfocus_resample_rows.py +198 -0
- openfocus-2.0.0/tests/test_openfocus_row_execution.py +509 -0
- openfocus-2.0.0/tests/test_openfocus_streaming.py +836 -0
- openfocus-2.0.0/tests/test_openfocus_wide_alignment.py +547 -0
- openfocus-2.0.0/tests/test_ort_operator_trace.py +64 -0
- openfocus-2.0.0/tests/test_output_label_publication.py +72 -0
- openfocus-2.0.0/tests/test_output_selection_binding.py +37 -0
- openfocus-2.0.0/tests/test_output_sharing.py +757 -0
- openfocus-2.0.0/tests/test_output_sharpen.py +209 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_packaging_contract.py +57 -1
- openfocus-2.0.0/tests/test_packaging_report.py +107 -0
- openfocus-2.0.0/tests/test_parameter_help.py +86 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_parameter_memory.py +441 -269
- openfocus-2.0.0/tests/test_path_identity.py +49 -0
- openfocus-2.0.0/tests/test_performance_profile.py +346 -0
- openfocus-2.0.0/tests/test_performance_profile_classical.py +132 -0
- openfocus-2.0.0/tests/test_performance_profile_fusion.py +137 -0
- openfocus-2.0.0/tests/test_performance_profile_render.py +140 -0
- openfocus-2.0.0/tests/test_planned_tile_overlap.py +122 -0
- openfocus-2.0.0/tests/test_project_dirty.py +121 -0
- openfocus-2.0.0/tests/test_project_dirty_settings.py +330 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_project_file.py +122 -2
- openfocus-2.0.0/tests/test_publish_release.py +207 -0
- openfocus-2.0.0/tests/test_raw_input.py +419 -0
- openfocus-2.0.0/tests/test_recipes.py +484 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_registration.py +103 -43
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_registration_resources.py +223 -14
- openfocus-2.0.0/tests/test_release_archives.py +679 -0
- openfocus-2.0.0/tests/test_release_metadata.py +339 -0
- openfocus-2.0.0/tests/test_release_workflows.py +247 -0
- openfocus-2.0.0/tests/test_render_after_load.py +335 -0
- openfocus-2.0.0/tests/test_render_context_roi.py +170 -0
- openfocus-2.0.0/tests/test_render_process.py +1127 -0
- openfocus-2.0.0/tests/test_render_setting_lock_and_preview_export.py +112 -0
- openfocus-2.0.0/tests/test_report_bundle.py +285 -0
- openfocus-2.0.0/tests/test_report_client.py +439 -0
- openfocus-2.0.0/tests/test_report_concurrency.py +348 -0
- openfocus-2.0.0/tests/test_report_lock.py +141 -0
- openfocus-2.0.0/tests/test_required_account.py +169 -0
- openfocus-2.0.0/tests/test_resource_policy.py +866 -0
- openfocus-2.0.0/tests/test_retained_frames.py +309 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_retouch.py +1750 -1140
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_retouch_checkpoint.py +174 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_retouch_checkpoint_gui.py +521 -318
- openfocus-2.0.0/tests/test_retouch_export.py +285 -0
- openfocus-2.0.0/tests/test_retouch_navigation_previews.py +129 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_retouch_replay_cli.py +114 -0
- openfocus-2.0.0/tests/test_retouch_ui_contract.py +130 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_review_round2.py +45 -2
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_review_round3.py +1 -1
- openfocus-2.0.0/tests/test_roi_deferred_consumers.py +379 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_scalebar.py +428 -13
- openfocus-2.0.0/tests/test_scratch_registry.py +464 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_sensor_cleanup_workers.py +56 -11
- openfocus-2.0.0/tests/test_settings_session_isolation.py +97 -0
- openfocus-2.0.0/tests/test_settings_tools.py +1390 -0
- openfocus-2.0.0/tests/test_sharpness_previews.py +258 -0
- openfocus-2.0.0/tests/test_site_download.py +61 -0
- openfocus-2.0.0/tests/test_site_worker.py +140 -0
- openfocus-2.0.0/tests/test_soak_status.py +32 -0
- openfocus-2.0.0/tests/test_source_exif_undo.py +145 -0
- openfocus-2.0.0/tests/test_source_frames.py +1321 -0
- openfocus-2.0.0/tests/test_source_hover.py +81 -0
- openfocus-2.0.0/tests/test_source_open_supervision.py +74 -0
- openfocus-2.0.0/tests/test_source_regions.py +910 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_stack_reset.py +163 -7
- openfocus-2.0.0/tests/test_stack_review.py +69 -0
- openfocus-2.0.0/tests/test_stack_review_gui.py +617 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_stack_tools.py +6 -6
- openfocus-2.0.0/tests/test_stackmff_cpu_benchmark.py +287 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_stackmff_models.py +15 -9
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_standalone_retouch.py +98 -0
- openfocus-2.0.0/tests/test_storage_preflight.py +782 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_streaming_backends.py +41 -23
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_torch_backend.py +26 -32
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_transparency.py +9 -14
- openfocus-2.0.0/tests/test_ui_audit.py +69 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_ui_layout.py +170 -92
- openfocus-2.0.0/tests/test_ui_perf_probe.py +76 -0
- openfocus-2.0.0/tests/test_ui_themes.py +679 -0
- openfocus-2.0.0/tests/test_update_contract.py +692 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_update_flow.py +153 -99
- openfocus-2.0.0/tests/test_updater.py +628 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_usage_analytics.py +31 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_v116_units.py +60 -37
- openfocus-2.0.0/tests/test_view_input_regressions.py +175 -0
- openfocus-2.0.0/tests/test_watermark.py +761 -0
- openfocus-2.0.0/tests/test_watermark_gui.py +1218 -0
- openfocus-2.0.0/tests/test_watermark_recovery.py +204 -0
- openfocus-2.0.0/tests/test_window_geometry.py +226 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_wipe_compare.py +199 -10
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_worker_diagnostics.py +62 -13
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_worker_lifecycle.py +158 -62
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_workflow_project_contract.py +660 -453
- openfocus-2.0.0/tests/test_zoom_anchor.py +274 -0
- openfocus-2.0.0/utils/_account_callback_page.py +163 -0
- openfocus-2.0.0/utils/account_client.py +1035 -0
- openfocus-2.0.0/utils/align_cache.py +574 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/app_paths.py +34 -2
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/design_tokens.py +68 -4
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/diagnostics.py +132 -21
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/dust_map.py +43 -3
- openfocus-2.0.0/utils/export_paths.py +139 -0
- openfocus-2.0.0/utils/file_dialogs.py +565 -0
- openfocus-2.0.0/utils/file_manager.py +179 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/fonts.py +90 -70
- openfocus-2.0.0/utils/frame_pixels.py +199 -0
- openfocus-2.0.0/utils/image_utils.py +1244 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/layered_tiff.py +43 -11
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/linear_dng.py +847 -766
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/logging_setup.py +118 -25
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/memory.py +123 -19
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/mesh_export.py +124 -25
- openfocus-2.0.0/utils/output_share.py +112 -0
- openfocus-2.0.0/utils/output_sharpen.py +41 -0
- openfocus-2.0.0/utils/path_identity.py +42 -0
- openfocus-2.0.0/utils/performance_profile.py +615 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/platform_utils.py +47 -126
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/project_file.py +239 -59
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/recovery.py +7 -3
- openfocus-2.0.0/utils/release_notes.py +331 -0
- openfocus-2.0.0/utils/report_bundle.py +555 -0
- openfocus-2.0.0/utils/report_client.py +447 -0
- openfocus-2.0.0/utils/reporting.py +71 -0
- openfocus-2.0.0/utils/retouch.py +1405 -0
- openfocus-2.0.0/utils/retouch_checkpoint.py +836 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/scalebar.py +111 -65
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/self_update.py +138 -182
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/settings_store.py +366 -20
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/sorting.py +2 -2
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/standalone_retouch.py +43 -5
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/ui_utils.py +22 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/updater.py +159 -53
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/usage_analytics.py +20 -8
- openfocus-2.0.0/utils/watermark.py +1041 -0
- openfocus-2.0.0/weights/stackmff_final.pth +0 -0
- openfocus-2.0.0/weights/stackmff_v2_final.pth +0 -0
- openfocus-2.0.0/weights/stackmff_v3_final.pth +0 -0
- openfocus-1.76.0/core/algorithm_adapters.py +0 -129
- openfocus-1.76.0/core/app.py +0 -162
- openfocus-1.76.0/core/batch_converter.py +0 -535
- openfocus-1.76.0/core/frame_storage.py +0 -82
- openfocus-1.76.0/core/mosaic.py +0 -321
- openfocus-1.76.0/core/openfocus_align.py +0 -132
- openfocus-1.76.0/core/render_context.py +0 -301
- openfocus-1.76.0/core/source_frames.py +0 -601
- openfocus-1.76.0/core/source_previews.py +0 -61
- openfocus-1.76.0/fusion_methods/dct.py +0 -272
- openfocus-1.76.0/fusion_methods/gff.py +0 -259
- openfocus-1.76.0/fusion_methods/neural_runtime.py +0 -306
- openfocus-1.76.0/fusion_methods/openfocus_a.py +0 -93
- openfocus-1.76.0/fusion_methods/openfocus_ab.py +0 -163
- openfocus-1.76.0/fusion_methods/openfocus_bc.py +0 -157
- openfocus-1.76.0/fusion_methods/openfocus_depth.py +0 -174
- openfocus-1.76.0/fusion_methods/stackmff_v2_tiled.py +0 -209
- openfocus-1.76.0/locales/__init__.py +0 -155
- openfocus-1.76.0/tests/test_algorithms.py +0 -150
- openfocus-1.76.0/tests/test_alignment_cache_atomic.py +0 -178
- openfocus-1.76.0/tests/test_alignment_diagnostics_gui.py +0 -118
- openfocus-1.76.0/tests/test_batch_converter.py +0 -822
- openfocus-1.76.0/tests/test_batch_export_contract.py +0 -576
- openfocus-1.76.0/tests/test_cli_engineering.py +0 -730
- openfocus-1.76.0/tests/test_file_dialogs.py +0 -236
- openfocus-1.76.0/tests/test_frame_storage_admission.py +0 -296
- openfocus-1.76.0/tests/test_lazy_project_consumers.py +0 -174
- openfocus-1.76.0/tests/test_linear_raw_selection_gui.py +0 -115
- openfocus-1.76.0/tests/test_memory_guard.py +0 -164
- openfocus-1.76.0/tests/test_neural_runtime.py +0 -201
- openfocus-1.76.0/tests/test_neural_streaming.py +0 -113
- openfocus-1.76.0/tests/test_output_sharpen.py +0 -102
- openfocus-1.76.0/tests/test_project_dirty.py +0 -96
- openfocus-1.76.0/tests/test_raw_input.py +0 -78
- openfocus-1.76.0/tests/test_recipes.py +0 -240
- openfocus-1.76.0/tests/test_release_archives.py +0 -284
- openfocus-1.76.0/tests/test_release_metadata.py +0 -73
- openfocus-1.76.0/tests/test_resource_policy.py +0 -398
- openfocus-1.76.0/tests/test_settings_tools.py +0 -776
- openfocus-1.76.0/tests/test_site_worker.py +0 -54
- openfocus-1.76.0/tests/test_source_frames.py +0 -403
- openfocus-1.76.0/tests/test_stack_review.py +0 -31
- openfocus-1.76.0/tests/test_stack_review_gui.py +0 -236
- openfocus-1.76.0/tests/test_ui_themes.py +0 -73
- openfocus-1.76.0/tests/test_update_contract.py +0 -306
- openfocus-1.76.0/tests/test_updater.py +0 -363
- openfocus-1.76.0/tests/test_window_geometry.py +0 -43
- openfocus-1.76.0/tests/test_zoom_anchor.py +0 -142
- openfocus-1.76.0/utils/align_cache.py +0 -239
- openfocus-1.76.0/utils/export_paths.py +0 -67
- openfocus-1.76.0/utils/file_dialogs.py +0 -102
- openfocus-1.76.0/utils/frame_pixels.py +0 -89
- openfocus-1.76.0/utils/image_utils.py +0 -808
- openfocus-1.76.0/utils/output_sharpen.py +0 -25
- openfocus-1.76.0/utils/path_identity.py +0 -13
- openfocus-1.76.0/utils/retouch.py +0 -800
- openfocus-1.76.0/utils/retouch_checkpoint.py +0 -274
- {openfocus-1.76.0 → openfocus-2.0.0}/LICENSE +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/control/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/control/color_dialogs.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/depth_products.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/models/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/models/stackmff_v1/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/models/stackmff_v1/network.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/models/stackmff_v2/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/models/stackmff_v2/network.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/models/stackmff_v3/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/models/stackmff_v3/model_io.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/models/stackmff_v3/network.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/torch_backend.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/core/transparency.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/fusion_methods/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/openfocus.egg-info/dependency_links.txt +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/openfocus.egg-info/entry_points.txt +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/setup.cfg +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_annotation_removal.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_atomic_image_export.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_dtcwt_determinism.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_exif_16bit_export.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_exif_orientation.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_frame_list.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_gff_frame_skip.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_gfg_fgf.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_golden.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_gpu_distribution.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_i18n_placeholders.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_label_range.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_magnifier_wheel_size.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_output_list.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_sensor_cleanup.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/tests/test_stackmffv3.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/colormap.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/label_model.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/sensor_cleanup.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/validators.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/utils/weights.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/weights/__init__.py +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/weights/stackmff_final.onnx +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/weights/stackmff_v2_final.onnx +0 -0
- {openfocus-1.76.0 → openfocus-2.0.0}/weights/stackmff_v3_final.onnx +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openfocus
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Multi-focus image fusion from the command line, with registration, classical methods, OpenFocus A/B/C and neural models
|
|
5
5
|
Author-email: Xinzhe Xie <xiexinzheyyy@163.com>
|
|
6
6
|
License-Expression: MIT AND LicenseRef-StackMFF-V3-1.0
|
|
@@ -22,16 +22,20 @@ License-File: docs/THIRD_PARTY_NOTICES.md
|
|
|
22
22
|
Requires-Dist: numpy
|
|
23
23
|
Requires-Dist: opencv-python-headless
|
|
24
24
|
Requires-Dist: scipy
|
|
25
|
-
Requires-Dist: dtcwt; python_version < "3.13"
|
|
25
|
+
Requires-Dist: dtcwt==0.14.0; python_version < "3.13"
|
|
26
|
+
Requires-Dist: six
|
|
26
27
|
Requires-Dist: imageio
|
|
27
28
|
Requires-Dist: Pillow
|
|
28
29
|
Requires-Dist: psdtags==2024.5.24
|
|
29
30
|
Requires-Dist: tifffile==2024.8.30
|
|
31
|
+
Requires-Dist: imagecodecs>=2024.9.22
|
|
30
32
|
Requires-Dist: onnxruntime-directml==1.23.0; sys_platform == "win32" and platform_machine == "AMD64"
|
|
31
33
|
Requires-Dist: onnxruntime<1.24,>=1.23; sys_platform != "win32" or platform_machine != "AMD64"
|
|
32
34
|
Requires-Dist: pillow-heif
|
|
33
35
|
Requires-Dist: rawpy>=0.25.1
|
|
34
36
|
Requires-Dist: threadpoolctl>=3.5
|
|
37
|
+
Requires-Dist: numba>=0.61.2
|
|
38
|
+
Requires-Dist: pyopencl>=2025.2.7; sys_platform == "win32" or sys_platform == "darwin" or sys_platform == "linux"
|
|
35
39
|
Dynamic: license-file
|
|
36
40
|
|
|
37
41
|
<p align="center">
|
|
@@ -58,7 +62,7 @@ Dynamic: license-file
|
|
|
58
62
|
<p align="center">
|
|
59
63
|
<img src="https://img.shields.io/badge/Windows-10%2F11-0078D7?logo=windows&logoColor=white" alt="Windows 10/11">
|
|
60
64
|
<img src="https://img.shields.io/badge/macOS-Apple%20Silicon-000000?logo=apple&logoColor=white" alt="macOS Apple Silicon">
|
|
61
|
-
<img src="https://img.shields.io/badge/Linux-
|
|
65
|
+
<img src="https://img.shields.io/badge/Linux-x86--64-FCC624?logo=linux&logoColor=black" alt="Linux x86-64 desktop and CLI">
|
|
62
66
|
<a href="https://pypi.org/project/openfocus/"><img src="https://img.shields.io/badge/PyPI-openfocus-3775A9?logo=pypi&logoColor=white" alt="PyPI"></a>
|
|
63
67
|
</p>
|
|
64
68
|
|
|
@@ -91,9 +95,7 @@ Dynamic: license-file
|
|
|
91
95
|
## 📢 News
|
|
92
96
|
|
|
93
97
|
> [!NOTE]
|
|
94
|
-
> **
|
|
95
|
-
> stacks, alignment diagnostics, enhanced depth exports and a refreshed desktop
|
|
96
|
-
> workflow. See the changelog for supported inputs and feature limitations.
|
|
98
|
+
> **OpenFocus 2.0.0** adds a Linux desktop build, GPU acceleration for OpenFocus A/B/C on compatible devices, and original-pixel inspection with reusable method comparisons. [Download](https://openfocus.top/#download) · [Changelog](./CHANGELOG.md#200)
|
|
97
99
|
|
|
98
100
|
Earlier releases are in the [Changelog](./CHANGELOG.md).
|
|
99
101
|
|
|
@@ -172,7 +174,7 @@ Create depth maps, calibrate physical Z, and export textured 3D surfaces.
|
|
|
172
174
|
|
|
173
175
|
### Source-locked retouch
|
|
174
176
|
|
|
175
|
-
Paint details from contributing source frames onto the fused result.
|
|
177
|
+
Paint details from contributing source frames onto the fused result. Auto background swaps a messy stacked background for one real frame and shows where no frame saw the scene clearly.
|
|
176
178
|
|
|
177
179
|
</td>
|
|
178
180
|
<td width="54%">
|
|
@@ -245,19 +247,24 @@ Control the desktop app through a token-protected local channel.
|
|
|
245
247
|
|
|
246
248
|
**Also in the box:**
|
|
247
249
|
|
|
248
|
-
- **Workflow** — stack browser, sharpness curve,
|
|
250
|
+
- **Workflow** — stack browser, sharpness curve, original-pixel zoom and loupe, ROI and reusable settings.
|
|
249
251
|
- **Microscopy** — 16-bit processing, TIFF Z-stacks, calibration and dust correction.
|
|
250
252
|
- **Image formats** — supported transparent PNG stacks and ICC profile preservation.
|
|
251
|
-
- **Headless CLI** — batch processing and JSON output
|
|
253
|
+
- **Headless CLI** — batch processing, reusable recipes, EXIF focus ordering, auto background and JSON output.
|
|
252
254
|
- **Projects and recovery** — session files, undo/redo and crash recovery.
|
|
253
255
|
- **Languages** — twelve UI languages with automatic locale detection.
|
|
254
|
-
- **Memory** — neural models
|
|
256
|
+
- **Memory** — bounded frame/tile work, disk-backed intermediates and neural models loaded only when selected.
|
|
255
257
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
OpenFocus A, B and C are the stable fusion methods. To use the other fusion
|
|
259
|
+
methods, enable **Experimental features** in Advanced Settings or pass
|
|
260
|
+
`--experimental` to the headless CLI.
|
|
261
|
+
|
|
262
|
+
StackMFF V1/V2/V3 run with the bundled ONNX Runtime. Supported Windows x64
|
|
263
|
+
NVIDIA systems can install TensorRT and PyTorch CUDA from **Settings → AI
|
|
264
|
+
acceleration components**. With GPU acceleration enabled, OpenFocus tries the
|
|
265
|
+
applicable native engines, then an accelerated ONNX Runtime provider such as
|
|
266
|
+
DirectML or CoreML, then CPU. Diagnostics record the engine used by the model.
|
|
267
|
+
See [GPU support](docs/GPU_SUPPORT.md).
|
|
261
268
|
|
|
262
269
|
Neural inference adapts spatial tile size to available resources while keeping
|
|
263
270
|
all focal frames in each inference. Imported frames and alignment scratch can
|
|
@@ -267,13 +274,18 @@ they may be rejected when those resources are insufficient. StackMFF V2's
|
|
|
267
274
|
spatial tiling is an approximation of whole-image inference and can change the
|
|
268
275
|
result. See [fusion methods](docs/FUSION_METHODS.md).
|
|
269
276
|
|
|
277
|
+
JPEG/RAW display previews use embedded data when available. Processing and
|
|
278
|
+
original-pixel inspection decode the source independently; a small preview never
|
|
279
|
+
replaces the pixels used for fusion. Keep enough free RAM and temporary disk
|
|
280
|
+
space for the selected source, processing workspace and full-size result.
|
|
281
|
+
|
|
270
282
|
<a id="install"></a>
|
|
271
283
|
## ⬇️ Install
|
|
272
284
|
|
|
273
|
-
|
|
285
|
+
The OpenFocus website offers stable desktop builds for Windows x64, macOS Apple Silicon and Linux x86-64. Extract the Linux archive and run `OpenFocus/OpenFocus`. Desktop updates use the stable channel by default. Enable beta updates in Advanced Settings or the welcome dialog to receive newer prereleases. Linux desktop updates are installed manually from the download page. [Desktop downloads](https://openfocus.top/#download) · [Release history](https://github.com/Xinzhe99/OpenFocus/releases)
|
|
274
286
|
|
|
275
|
-
On macOS (Apple Silicon) or Linux, install from a terminal. Linux
|
|
276
|
-
headless CLI; macOS installs the app in `~/Applications`.
|
|
287
|
+
On macOS (Apple Silicon) or Linux, install from a terminal. On Linux this
|
|
288
|
+
command installs the headless CLI; on macOS it installs the app in `~/Applications`.
|
|
277
289
|
|
|
278
290
|
```bash
|
|
279
291
|
curl -fsSL https://openfocus.top/install.sh | sh
|
|
@@ -319,28 +331,58 @@ pip install openfocus
|
|
|
319
331
|
openfocus -i ./stack_folder -o ./result/fused.png
|
|
320
332
|
```
|
|
321
333
|
|
|
334
|
+
For unattended background replacement while retaining the original fusion and
|
|
335
|
+
its missing-data map:
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
openfocus -i ./stack_folder -o ./result/fused.tif --auto-background auto --save-stacked --missing-data-map
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Folder inputs use EXIF focus steps when every frame supplies them and the
|
|
342
|
+
near-to-far step direction is known; otherwise they keep natural filename order. Use `--frame-order name` to force filename order;
|
|
343
|
+
explicitly listed files retain their supplied order.
|
|
344
|
+
|
|
345
|
+
Recipes preserve native RAW conversion mode and batch output format. Run
|
|
346
|
+
transient duplicate and alignment reports through direct CLI invocations.
|
|
347
|
+
|
|
322
348
|
See the [CLI manual](./docs/USER_MANUAL_EN.md#14-command-line-interface).
|
|
323
349
|
|
|
324
350
|
<a id="community"></a>
|
|
325
351
|
## Community & Support
|
|
326
352
|
|
|
327
|
-
Questions, ideas or feedback? Join our [Discord community](https://discord.gg/
|
|
353
|
+
Questions, ideas or feedback? Join our [Discord community](https://discord.gg/Jamr2SR5). We reply as soon as we can; we're based in Beijing (UTC+8), so time differences may affect response times.
|
|
328
354
|
|
|
329
355
|
- **Docs** — [User Manual](./docs/USER_MANUAL_EN.md) (twelve languages) · [Changelog](./CHANGELOG.md) · [Performance](./docs/PERFORMANCE.md) · [Fusion methods](./docs/FUSION_METHODS.md)
|
|
330
|
-
-
|
|
356
|
+
- [Privacy policy](./docs/PRIVACY.md)
|
|
331
357
|
- **Citation** — [CITATION.cff](./CITATION.cff); every release is archived on Zenodo ([DOI](https://doi.org/10.5281/zenodo.23050823))
|
|
332
358
|
- **Feedback** — open an [issue](https://github.com/Xinzhe99/OpenFocus/issues) for bugs, ideas and algorithm work
|
|
333
359
|
- **Credits** — each fusion/registration algorithm keeps its original research licence; StackMFF V3 lives at [Xinzhe99/StackMFF-V3](https://github.com/Xinzhe99/StackMFF-V3)
|
|
334
360
|
|
|
335
|
-
**WeChat
|
|
361
|
+
**WeChat:** Scan to join the OpenFocus group or follow our official account.
|
|
336
362
|
|
|
337
|
-
<
|
|
363
|
+
<table>
|
|
364
|
+
<tr>
|
|
365
|
+
<th align="center">WeChat group</th>
|
|
366
|
+
<th align="center">Official account</th>
|
|
367
|
+
</tr>
|
|
368
|
+
<tr>
|
|
369
|
+
<td align="center" valign="top"><img src="assets/readme/wechat-group.png" alt="QR code for the OpenFocus WeChat group" width="260"></td>
|
|
370
|
+
<td align="center" valign="top"><img src="assets/readme/wechat-official-account.jpg" alt="QR code for the OpenFocus WeChat official account" width="260"></td>
|
|
371
|
+
</tr>
|
|
372
|
+
</table>
|
|
338
373
|
|
|
339
374
|
**Support OpenFocus:** If you enjoy the software, you can buy us a coffee via Alipay in China or [PayPal](https://paypal.me/XinZEN0602) internationally. Include your username in the payment note and we will permanently acknowledge it in the project as a thank-you.
|
|
340
375
|
|
|
341
|
-
<
|
|
342
|
-
|
|
343
|
-
<
|
|
376
|
+
<table>
|
|
377
|
+
<tr>
|
|
378
|
+
<th align="center">Alipay · China</th>
|
|
379
|
+
<th align="center">PayPal · International</th>
|
|
380
|
+
</tr>
|
|
381
|
+
<tr>
|
|
382
|
+
<td align="center" valign="top"><img src="assets/readme/alipay-coffee.jpg" alt="Alipay QR code to support OpenFocus" width="260"></td>
|
|
383
|
+
<td align="center" valign="top"><a href="https://paypal.me/XinZEN0602"><img src="assets/readme/paypal-coffee.png" alt="PayPal QR code with the PayPal mark; scan or click to support OpenFocus" width="260"></a><br><a href="https://paypal.me/XinZEN0602">Scan or click to donate via PayPal</a></td>
|
|
384
|
+
</tr>
|
|
385
|
+
</table>
|
|
344
386
|
|
|
345
387
|
<a id="license"></a>
|
|
346
388
|
## License
|
|
@@ -364,6 +406,24 @@ pip install -r requirements.txt
|
|
|
364
406
|
python main.py
|
|
365
407
|
```
|
|
366
408
|
|
|
409
|
+
Install the shared development tools and run the regression suite:
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
python -m pip install -r requirements-dev.txt
|
|
413
|
+
python -m pytest -q --timeout=90 --timeout-method=thread
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
On a headless host, set `QT_QPA_PLATFORM=offscreen`. CI uses these same dependency
|
|
417
|
+
files on Windows, macOS and Linux. A change to processing, cancellation or GUI
|
|
418
|
+
state also needs a real CLI/desktop smoke run; tests alone do not exercise the
|
|
419
|
+
packaged application.
|
|
420
|
+
|
|
421
|
+
Keep algorithm descriptors in `core/algorithms.py`, shared processing in
|
|
422
|
+
`core`/`utils`, and UI snapshots/dialog orchestration in the controllers. New
|
|
423
|
+
methods declare parameters, resource estimates and capabilities once; consumers
|
|
424
|
+
derive their choices from that descriptor. Preserve bit depth, source order,
|
|
425
|
+
cooperative cancellation and the admitted thread/RAM limits.
|
|
426
|
+
|
|
367
427
|
Packaging with PyInstaller: [docs/BUILD_COMMANDS.md](./docs/BUILD_COMMANDS.md).
|
|
368
428
|
|
|
369
429
|
Adding a fusion or registration algorithm: [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<p align="center">
|
|
23
23
|
<img src="https://img.shields.io/badge/Windows-10%2F11-0078D7?logo=windows&logoColor=white" alt="Windows 10/11">
|
|
24
24
|
<img src="https://img.shields.io/badge/macOS-Apple%20Silicon-000000?logo=apple&logoColor=white" alt="macOS Apple Silicon">
|
|
25
|
-
<img src="https://img.shields.io/badge/Linux-
|
|
25
|
+
<img src="https://img.shields.io/badge/Linux-x86--64-FCC624?logo=linux&logoColor=black" alt="Linux x86-64 desktop and CLI">
|
|
26
26
|
<a href="https://pypi.org/project/openfocus/"><img src="https://img.shields.io/badge/PyPI-openfocus-3775A9?logo=pypi&logoColor=white" alt="PyPI"></a>
|
|
27
27
|
</p>
|
|
28
28
|
|
|
@@ -55,9 +55,7 @@
|
|
|
55
55
|
## 📢 News
|
|
56
56
|
|
|
57
57
|
> [!NOTE]
|
|
58
|
-
> **
|
|
59
|
-
> stacks, alignment diagnostics, enhanced depth exports and a refreshed desktop
|
|
60
|
-
> workflow. See the changelog for supported inputs and feature limitations.
|
|
58
|
+
> **OpenFocus 2.0.0** adds a Linux desktop build, GPU acceleration for OpenFocus A/B/C on compatible devices, and original-pixel inspection with reusable method comparisons. [Download](https://openfocus.top/#download) · [Changelog](./CHANGELOG.md#200)
|
|
61
59
|
|
|
62
60
|
Earlier releases are in the [Changelog](./CHANGELOG.md).
|
|
63
61
|
|
|
@@ -136,7 +134,7 @@ Create depth maps, calibrate physical Z, and export textured 3D surfaces.
|
|
|
136
134
|
|
|
137
135
|
### Source-locked retouch
|
|
138
136
|
|
|
139
|
-
Paint details from contributing source frames onto the fused result.
|
|
137
|
+
Paint details from contributing source frames onto the fused result. Auto background swaps a messy stacked background for one real frame and shows where no frame saw the scene clearly.
|
|
140
138
|
|
|
141
139
|
</td>
|
|
142
140
|
<td width="54%">
|
|
@@ -209,19 +207,24 @@ Control the desktop app through a token-protected local channel.
|
|
|
209
207
|
|
|
210
208
|
**Also in the box:**
|
|
211
209
|
|
|
212
|
-
- **Workflow** — stack browser, sharpness curve,
|
|
210
|
+
- **Workflow** — stack browser, sharpness curve, original-pixel zoom and loupe, ROI and reusable settings.
|
|
213
211
|
- **Microscopy** — 16-bit processing, TIFF Z-stacks, calibration and dust correction.
|
|
214
212
|
- **Image formats** — supported transparent PNG stacks and ICC profile preservation.
|
|
215
|
-
- **Headless CLI** — batch processing and JSON output
|
|
213
|
+
- **Headless CLI** — batch processing, reusable recipes, EXIF focus ordering, auto background and JSON output.
|
|
216
214
|
- **Projects and recovery** — session files, undo/redo and crash recovery.
|
|
217
215
|
- **Languages** — twelve UI languages with automatic locale detection.
|
|
218
|
-
- **Memory** — neural models
|
|
216
|
+
- **Memory** — bounded frame/tile work, disk-backed intermediates and neural models loaded only when selected.
|
|
219
217
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
218
|
+
OpenFocus A, B and C are the stable fusion methods. To use the other fusion
|
|
219
|
+
methods, enable **Experimental features** in Advanced Settings or pass
|
|
220
|
+
`--experimental` to the headless CLI.
|
|
221
|
+
|
|
222
|
+
StackMFF V1/V2/V3 run with the bundled ONNX Runtime. Supported Windows x64
|
|
223
|
+
NVIDIA systems can install TensorRT and PyTorch CUDA from **Settings → AI
|
|
224
|
+
acceleration components**. With GPU acceleration enabled, OpenFocus tries the
|
|
225
|
+
applicable native engines, then an accelerated ONNX Runtime provider such as
|
|
226
|
+
DirectML or CoreML, then CPU. Diagnostics record the engine used by the model.
|
|
227
|
+
See [GPU support](docs/GPU_SUPPORT.md).
|
|
225
228
|
|
|
226
229
|
Neural inference adapts spatial tile size to available resources while keeping
|
|
227
230
|
all focal frames in each inference. Imported frames and alignment scratch can
|
|
@@ -231,13 +234,18 @@ they may be rejected when those resources are insufficient. StackMFF V2's
|
|
|
231
234
|
spatial tiling is an approximation of whole-image inference and can change the
|
|
232
235
|
result. See [fusion methods](docs/FUSION_METHODS.md).
|
|
233
236
|
|
|
237
|
+
JPEG/RAW display previews use embedded data when available. Processing and
|
|
238
|
+
original-pixel inspection decode the source independently; a small preview never
|
|
239
|
+
replaces the pixels used for fusion. Keep enough free RAM and temporary disk
|
|
240
|
+
space for the selected source, processing workspace and full-size result.
|
|
241
|
+
|
|
234
242
|
<a id="install"></a>
|
|
235
243
|
## ⬇️ Install
|
|
236
244
|
|
|
237
|
-
|
|
245
|
+
The OpenFocus website offers stable desktop builds for Windows x64, macOS Apple Silicon and Linux x86-64. Extract the Linux archive and run `OpenFocus/OpenFocus`. Desktop updates use the stable channel by default. Enable beta updates in Advanced Settings or the welcome dialog to receive newer prereleases. Linux desktop updates are installed manually from the download page. [Desktop downloads](https://openfocus.top/#download) · [Release history](https://github.com/Xinzhe99/OpenFocus/releases)
|
|
238
246
|
|
|
239
|
-
On macOS (Apple Silicon) or Linux, install from a terminal. Linux
|
|
240
|
-
headless CLI; macOS installs the app in `~/Applications`.
|
|
247
|
+
On macOS (Apple Silicon) or Linux, install from a terminal. On Linux this
|
|
248
|
+
command installs the headless CLI; on macOS it installs the app in `~/Applications`.
|
|
241
249
|
|
|
242
250
|
```bash
|
|
243
251
|
curl -fsSL https://openfocus.top/install.sh | sh
|
|
@@ -283,28 +291,58 @@ pip install openfocus
|
|
|
283
291
|
openfocus -i ./stack_folder -o ./result/fused.png
|
|
284
292
|
```
|
|
285
293
|
|
|
294
|
+
For unattended background replacement while retaining the original fusion and
|
|
295
|
+
its missing-data map:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
openfocus -i ./stack_folder -o ./result/fused.tif --auto-background auto --save-stacked --missing-data-map
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Folder inputs use EXIF focus steps when every frame supplies them and the
|
|
302
|
+
near-to-far step direction is known; otherwise they keep natural filename order. Use `--frame-order name` to force filename order;
|
|
303
|
+
explicitly listed files retain their supplied order.
|
|
304
|
+
|
|
305
|
+
Recipes preserve native RAW conversion mode and batch output format. Run
|
|
306
|
+
transient duplicate and alignment reports through direct CLI invocations.
|
|
307
|
+
|
|
286
308
|
See the [CLI manual](./docs/USER_MANUAL_EN.md#14-command-line-interface).
|
|
287
309
|
|
|
288
310
|
<a id="community"></a>
|
|
289
311
|
## Community & Support
|
|
290
312
|
|
|
291
|
-
Questions, ideas or feedback? Join our [Discord community](https://discord.gg/
|
|
313
|
+
Questions, ideas or feedback? Join our [Discord community](https://discord.gg/Jamr2SR5). We reply as soon as we can; we're based in Beijing (UTC+8), so time differences may affect response times.
|
|
292
314
|
|
|
293
315
|
- **Docs** — [User Manual](./docs/USER_MANUAL_EN.md) (twelve languages) · [Changelog](./CHANGELOG.md) · [Performance](./docs/PERFORMANCE.md) · [Fusion methods](./docs/FUSION_METHODS.md)
|
|
294
|
-
-
|
|
316
|
+
- [Privacy policy](./docs/PRIVACY.md)
|
|
295
317
|
- **Citation** — [CITATION.cff](./CITATION.cff); every release is archived on Zenodo ([DOI](https://doi.org/10.5281/zenodo.23050823))
|
|
296
318
|
- **Feedback** — open an [issue](https://github.com/Xinzhe99/OpenFocus/issues) for bugs, ideas and algorithm work
|
|
297
319
|
- **Credits** — each fusion/registration algorithm keeps its original research licence; StackMFF V3 lives at [Xinzhe99/StackMFF-V3](https://github.com/Xinzhe99/StackMFF-V3)
|
|
298
320
|
|
|
299
|
-
**WeChat
|
|
321
|
+
**WeChat:** Scan to join the OpenFocus group or follow our official account.
|
|
300
322
|
|
|
301
|
-
<
|
|
323
|
+
<table>
|
|
324
|
+
<tr>
|
|
325
|
+
<th align="center">WeChat group</th>
|
|
326
|
+
<th align="center">Official account</th>
|
|
327
|
+
</tr>
|
|
328
|
+
<tr>
|
|
329
|
+
<td align="center" valign="top"><img src="assets/readme/wechat-group.png" alt="QR code for the OpenFocus WeChat group" width="260"></td>
|
|
330
|
+
<td align="center" valign="top"><img src="assets/readme/wechat-official-account.jpg" alt="QR code for the OpenFocus WeChat official account" width="260"></td>
|
|
331
|
+
</tr>
|
|
332
|
+
</table>
|
|
302
333
|
|
|
303
334
|
**Support OpenFocus:** If you enjoy the software, you can buy us a coffee via Alipay in China or [PayPal](https://paypal.me/XinZEN0602) internationally. Include your username in the payment note and we will permanently acknowledge it in the project as a thank-you.
|
|
304
335
|
|
|
305
|
-
<
|
|
306
|
-
|
|
307
|
-
<
|
|
336
|
+
<table>
|
|
337
|
+
<tr>
|
|
338
|
+
<th align="center">Alipay · China</th>
|
|
339
|
+
<th align="center">PayPal · International</th>
|
|
340
|
+
</tr>
|
|
341
|
+
<tr>
|
|
342
|
+
<td align="center" valign="top"><img src="assets/readme/alipay-coffee.jpg" alt="Alipay QR code to support OpenFocus" width="260"></td>
|
|
343
|
+
<td align="center" valign="top"><a href="https://paypal.me/XinZEN0602"><img src="assets/readme/paypal-coffee.png" alt="PayPal QR code with the PayPal mark; scan or click to support OpenFocus" width="260"></a><br><a href="https://paypal.me/XinZEN0602">Scan or click to donate via PayPal</a></td>
|
|
344
|
+
</tr>
|
|
345
|
+
</table>
|
|
308
346
|
|
|
309
347
|
<a id="license"></a>
|
|
310
348
|
## License
|
|
@@ -328,6 +366,24 @@ pip install -r requirements.txt
|
|
|
328
366
|
python main.py
|
|
329
367
|
```
|
|
330
368
|
|
|
369
|
+
Install the shared development tools and run the regression suite:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
python -m pip install -r requirements-dev.txt
|
|
373
|
+
python -m pytest -q --timeout=90 --timeout-method=thread
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
On a headless host, set `QT_QPA_PLATFORM=offscreen`. CI uses these same dependency
|
|
377
|
+
files on Windows, macOS and Linux. A change to processing, cancellation or GUI
|
|
378
|
+
state also needs a real CLI/desktop smoke run; tests alone do not exercise the
|
|
379
|
+
packaged application.
|
|
380
|
+
|
|
381
|
+
Keep algorithm descriptors in `core/algorithms.py`, shared processing in
|
|
382
|
+
`core`/`utils`, and UI snapshots/dialog orchestration in the controllers. New
|
|
383
|
+
methods declare parameters, resource estimates and capabilities once; consumers
|
|
384
|
+
derive their choices from that descriptor. Preserve bit depth, source order,
|
|
385
|
+
cooperative cancellation and the admitted thread/RAM limits.
|
|
386
|
+
|
|
331
387
|
Packaging with PyInstaller: [docs/BUILD_COMMANDS.md](./docs/BUILD_COMMANDS.md).
|
|
332
388
|
|
|
333
389
|
Adding a fusion or registration algorithm: [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
APP_VERSION = "
|
|
1
|
+
APP_VERSION = "2.0.0"
|
|
2
|
+
DISCORD_INVITE_URL = "https://discord.gg/Jamr2SR5"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def app_display_version():
|
|
6
|
+
"""Return the build identity while preserving the numeric package version."""
|
|
7
|
+
from build_identity import BETA_SUFFIX
|
|
8
|
+
return APP_VERSION + BETA_SUFFIX
|
|
9
|
+
|
|
2
10
|
|
|
3
11
|
WINDOW_WIDTH = 1600
|
|
4
12
|
WINDOW_HEIGHT = 950
|
|
@@ -20,6 +28,10 @@ STATUS_UPDATE_INTERVAL_MS = 2000
|
|
|
20
28
|
|
|
21
29
|
BYTES_TO_GB = 1024 ** 3
|
|
22
30
|
|
|
31
|
+
# Shared snapshots and numerical scratch leave room for source/preview caches.
|
|
32
|
+
FRAME_RAM_BUDGET_BYTES = 384 * 1024 ** 2
|
|
33
|
+
OPENFOCUS_MAX_IN_FLIGHT_FRAMES = 2
|
|
34
|
+
|
|
23
35
|
FEATURE_MAX_KEYPOINTS = 200
|
|
24
36
|
FEATURE_MATCH_THRESHOLD = 0.01
|
|
25
37
|
FEATURE_RANSAC_REJECTS = 30
|
|
@@ -31,6 +43,7 @@ ANIMATION_DURATION_MS = 400
|
|
|
31
43
|
DEFAULT_THREAD_COUNT = 4
|
|
32
44
|
MIN_THREAD_COUNT = 1
|
|
33
45
|
MAX_THREAD_COUNT = 16
|
|
46
|
+
NATIVE_WORKER_STACK_BYTES = 8 * 1024 ** 2
|
|
34
47
|
|
|
35
48
|
AI_BATCH_SIZE = 2
|
|
36
49
|
AI_BATCH_SIZE_MIN = 1
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""Native CPU kernels for the fast translation estimator.
|
|
2
|
+
|
|
3
|
+
These mirror the row-wise definitions in core.openfocus_alignment exactly:
|
|
4
|
+
uint32 accumulation, truncating integer division, edge replication and the
|
|
5
|
+
float32 sampler clamp order. Numba is optional; callers fall back to NumPy.
|
|
6
|
+
"""
|
|
7
|
+
import numpy as np
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
from numba import njit, prange
|
|
11
|
+
_HAVE_NUMBA = True
|
|
12
|
+
except Exception: # pragma: no cover - optional dependency
|
|
13
|
+
njit = None
|
|
14
|
+
prange = range
|
|
15
|
+
_HAVE_NUMBA = False
|
|
16
|
+
|
|
17
|
+
_WEIGHTS = (12, 64, 37, 2)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def available():
|
|
21
|
+
return _HAVE_NUMBA
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
if _HAVE_NUMBA:
|
|
25
|
+
@njit(cache=True, nogil=True)
|
|
26
|
+
def gray16_u8(image, out):
|
|
27
|
+
h, w = image.shape[:2]
|
|
28
|
+
take = min(image.shape[2], 3) if image.ndim == 3 else 1
|
|
29
|
+
for y in range(h):
|
|
30
|
+
for x in range(w):
|
|
31
|
+
if image.ndim == 2:
|
|
32
|
+
value = np.uint32(image[y, x])
|
|
33
|
+
else:
|
|
34
|
+
value = np.uint32(0)
|
|
35
|
+
for c in range(take):
|
|
36
|
+
value += np.uint32(image[y, x, c])
|
|
37
|
+
value //= np.uint32(take)
|
|
38
|
+
out[y, x] = np.uint16(value << np.uint32(8))
|
|
39
|
+
return out
|
|
40
|
+
|
|
41
|
+
@njit(cache=True, nogil=True)
|
|
42
|
+
def down_half(src):
|
|
43
|
+
h, w = src.shape
|
|
44
|
+
oh, ow = (h + 1) // 2, (w + 1) // 2
|
|
45
|
+
out = np.empty((oh, ow), np.uint16)
|
|
46
|
+
for oy in range(oh):
|
|
47
|
+
scratch = np.empty(w, np.uint32)
|
|
48
|
+
y = 2 * oy
|
|
49
|
+
for x in range(w):
|
|
50
|
+
v = np.uint32(0)
|
|
51
|
+
for i in range(4):
|
|
52
|
+
sy = y - 1 + i
|
|
53
|
+
if sy < 0:
|
|
54
|
+
sy = 0
|
|
55
|
+
elif sy >= h:
|
|
56
|
+
sy = h - 1
|
|
57
|
+
v += np.uint32(src[sy, x]) * np.uint32(_WEIGHTS[i])
|
|
58
|
+
scratch[x] = (v + np.uint32(57)) // np.uint32(115)
|
|
59
|
+
for ox in range(ow):
|
|
60
|
+
v = np.uint32(0)
|
|
61
|
+
for i in range(4):
|
|
62
|
+
sx = 2 * ox - 1 + i
|
|
63
|
+
if sx < 0:
|
|
64
|
+
sx = 0
|
|
65
|
+
elif sx >= w:
|
|
66
|
+
sx = w - 1
|
|
67
|
+
v += scratch[sx] * np.uint32(_WEIGHTS[i])
|
|
68
|
+
out[oy, ox] = np.uint16((v + np.uint32(57)) // np.uint32(115))
|
|
69
|
+
return out
|
|
70
|
+
|
|
71
|
+
if _HAVE_NUMBA:
|
|
72
|
+
@njit(cache=True, nogil=True)
|
|
73
|
+
def gray16_u16(image, out):
|
|
74
|
+
h, w = image.shape[:2]
|
|
75
|
+
take = min(image.shape[2], 3) if image.ndim == 3 else 1
|
|
76
|
+
for y in range(h):
|
|
77
|
+
for x in range(w):
|
|
78
|
+
if image.ndim == 2:
|
|
79
|
+
out[y, x] = np.uint16(image[y, x])
|
|
80
|
+
else:
|
|
81
|
+
value = np.uint32(0)
|
|
82
|
+
for c in range(take):
|
|
83
|
+
value += np.uint32(image[y, x, c])
|
|
84
|
+
out[y, x] = np.uint16(value // np.uint32(take))
|
|
85
|
+
return out
|
|
86
|
+
|
|
87
|
+
if _HAVE_NUMBA:
|
|
88
|
+
@njit(cache=True, nogil=True)
|
|
89
|
+
def _axis(coord, length):
|
|
90
|
+
extent = length
|
|
91
|
+
invalid = coord >= np.float32(extent) or coord < np.float32(0)
|
|
92
|
+
if coord >= np.float32(extent - 1):
|
|
93
|
+
coord = np.float32(extent) - np.float32(1.0010000467300415)
|
|
94
|
+
if coord < np.float32(0):
|
|
95
|
+
coord = np.float32(0)
|
|
96
|
+
index = np.int32(coord)
|
|
97
|
+
frac = np.uint32((coord - np.float32(index)) * np.float32(256))
|
|
98
|
+
lo = index
|
|
99
|
+
if lo < 0:
|
|
100
|
+
lo = 0
|
|
101
|
+
elif lo > length - 1:
|
|
102
|
+
lo = length - 1
|
|
103
|
+
hi = index + 1
|
|
104
|
+
if hi < 0:
|
|
105
|
+
hi = 0
|
|
106
|
+
elif hi > length - 1:
|
|
107
|
+
hi = length - 1
|
|
108
|
+
return lo, hi, frac, invalid
|
|
109
|
+
|
|
110
|
+
@njit(cache=True, nogil=True)
|
|
111
|
+
def warp_u16(image, dx, dy):
|
|
112
|
+
h, w = image.shape[:2]
|
|
113
|
+
out = np.empty_like(image)
|
|
114
|
+
channels = 1 if image.ndim == 2 else image.shape[2]
|
|
115
|
+
for y in range(h):
|
|
116
|
+
iy, jy, fy, inv_y = _axis(np.float32(y) - np.float32(dy), h)
|
|
117
|
+
gy = np.uint32(256) - fy
|
|
118
|
+
for x in range(w):
|
|
119
|
+
ix, jx, fx, inv_x = _axis(np.float32(x) - np.float32(dx), w)
|
|
120
|
+
gx = np.uint32(256) - fx
|
|
121
|
+
invalid = inv_y or inv_x
|
|
122
|
+
for c in range(channels):
|
|
123
|
+
if image.ndim == 2:
|
|
124
|
+
top = np.uint32(image[iy, ix]) * gx + np.uint32(image[iy, jx]) * fx
|
|
125
|
+
bottom = np.uint32(image[jy, ix]) * gx + np.uint32(image[jy, jx]) * fx
|
|
126
|
+
value = (top * gy + bottom * fy) >> np.uint32(16)
|
|
127
|
+
out[y, x] = np.uint16(0 if invalid else value)
|
|
128
|
+
else:
|
|
129
|
+
top = np.uint32(image[iy, ix, c]) * gx + np.uint32(image[iy, jx, c]) * fx
|
|
130
|
+
bottom = np.uint32(image[jy, ix, c]) * gx + np.uint32(image[jy, jx, c]) * fx
|
|
131
|
+
value = (top * gy + bottom * fy) >> np.uint32(16)
|
|
132
|
+
out[y, x, c] = np.uint16(0 if invalid else value)
|
|
133
|
+
return out
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
if _HAVE_NUMBA:
|
|
137
|
+
@njit(cache=True, nogil=True)
|
|
138
|
+
def _axis_pad(coord, length, pad):
|
|
139
|
+
extent = length + 2 * pad
|
|
140
|
+
invalid = coord >= np.float32(extent) or coord < np.float32(0)
|
|
141
|
+
if coord >= np.float32(extent - 1):
|
|
142
|
+
coord = np.float32(extent) - np.float32(1.0010000467300415)
|
|
143
|
+
if coord < np.float32(0):
|
|
144
|
+
coord = np.float32(0)
|
|
145
|
+
index = np.int32(coord)
|
|
146
|
+
frac = np.uint32((coord - np.float32(index)) * np.float32(256))
|
|
147
|
+
lo = index - pad
|
|
148
|
+
if lo < 0:
|
|
149
|
+
lo = 0
|
|
150
|
+
elif lo > length - 1:
|
|
151
|
+
lo = length - 1
|
|
152
|
+
hi = index + 1 - pad
|
|
153
|
+
if hi < 0:
|
|
154
|
+
hi = 0
|
|
155
|
+
elif hi > length - 1:
|
|
156
|
+
hi = length - 1
|
|
157
|
+
return lo, hi, frac, invalid
|
|
158
|
+
if _HAVE_NUMBA:
|
|
159
|
+
@njit(cache=True, nogil=True)
|
|
160
|
+
def refine_level(a, b, c_dx, c_dy, half, step, crop):
|
|
161
|
+
h, w = a.shape
|
|
162
|
+
pad = np.int32(np.ceil(max(abs(c_dx), abs(c_dy), np.float32(1.0)) + half)) + 1
|
|
163
|
+
n = min(crop, h, w)
|
|
164
|
+
cy, cx = (h - n) // 2, (w - n) // 2
|
|
165
|
+
count = np.int32(round(2.0 * half / step)) | 1
|
|
166
|
+
centre = (count - 1) // 2
|
|
167
|
+
best_score = np.float32(np.finfo(np.float32).max)
|
|
168
|
+
best_dx = np.float32(0.0)
|
|
169
|
+
best_dy = np.float32(0.0)
|
|
170
|
+
found = False
|
|
171
|
+
for oy in range(count):
|
|
172
|
+
ody = np.float32((oy - centre) * step)
|
|
173
|
+
dy = np.float32(c_dy + ody)
|
|
174
|
+
for ox in range(count):
|
|
175
|
+
odx = np.float32((ox - centre) * step)
|
|
176
|
+
dx = np.float32(c_dx + odx)
|
|
177
|
+
ssum = np.float64(0.0)
|
|
178
|
+
ssq = np.float64(0.0)
|
|
179
|
+
for yy in range(cy, cy + n):
|
|
180
|
+
ycoord = np.float32(np.float32(yy) + np.float32(pad) - dy)
|
|
181
|
+
iy, jy, fy, inv_y = _axis_pad(ycoord, h, pad)
|
|
182
|
+
gy = np.uint32(256) - fy
|
|
183
|
+
for xx in range(cx, cx + n):
|
|
184
|
+
xcoord = np.float32(np.float32(xx) + np.float32(pad) - dx)
|
|
185
|
+
ix, jx, fx, inv_x = _axis_pad(xcoord, w, pad)
|
|
186
|
+
gx = np.uint32(256) - fx
|
|
187
|
+
if inv_y or inv_x:
|
|
188
|
+
sample = 0
|
|
189
|
+
else:
|
|
190
|
+
top = np.uint32(b[iy, ix]) * gx + np.uint32(b[iy, jx]) * fx
|
|
191
|
+
bottom = np.uint32(b[jy, ix]) * gx + np.uint32(b[jy, jx]) * fx
|
|
192
|
+
sample = np.uint32((top * gy + bottom * fy) >> np.uint32(16))
|
|
193
|
+
diff = np.float64(a[yy, xx]) - np.float64(sample)
|
|
194
|
+
ssum += diff
|
|
195
|
+
ssq += diff * diff
|
|
196
|
+
total = np.float64(n * n)
|
|
197
|
+
mean = ssum / total
|
|
198
|
+
score = np.float64(np.sqrt(max(ssq / total - mean * mean, 0.0)))
|
|
199
|
+
if score < np.float64(best_score):
|
|
200
|
+
best_score = np.float32(score)
|
|
201
|
+
best_dx = dx
|
|
202
|
+
best_dy = dy
|
|
203
|
+
found = True
|
|
204
|
+
return best_dx, best_dy, found
|