better support for radiometric panels#2030
Draft
maurerle wants to merge 4 commits into
Draft
Conversation
Parse CalibrationPicture/Albedo/ReflectArea/PanelSerial directly from XMP (no exiftool dependency) and expose panel getters plus is_calibration_picture() and is_panel_image() helpers on ODM_Photo. Assisted-by: Cursor:opus-4.8
New opendm/panel.py provides polygon region statistics (mean/std and saturated pixel fraction) over a panel active area, used to derive panel irradiance. Assisted-by: Cursor:opus-4.8
Add compute_irradiance_from_panels() (median across panel captures, saturation rejection, graceful per-band fallback) and parse_panel_reflectance() for the --panel-reflectance override. Thread panel_irradiance through dn_to_reflectance and check it in compute_irradiance before the stored HorizontalIrradiance early return, so panel irradiance is actually used for DLS cameras. Assisted-by: Cursor:opus-4.8
Add the camera+panel choice and --panel-reflectance flag. The dataset stage detects calibration panel captures, computes and persists per-band irradiance to panels.json, and excludes panel frames from the reconstruction. run_opensfm loads that irradiance and passes it per band into dn_to_reflectance. Assisted-by: Cursor:opus-4.8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
For usage with a Micasense RedEdge-P, we are currently using the DLS reflectance from
camera+sun, however it is more accurate when preprocessing the Data with the micasense library: https://github.com/brainergylab/micasense_imageprocessing and using the QR panel adjustment from there.This PR adds the capability to ODM as well.
This PR is assisted by opus-4.8 and is currently untested.
I would like some early feedback and improve based on it, after testing that it works as intended.
I am aware of https://github.com/OpenDroneMap/documents/blob/master/CONTRIBUTING.md - which is why this is a draft.
Adds
--radiometric-calibration camera+panel, deriving per-band reflectancefrom in-field MicaSense (and compatible) calibration reflectance panel captures.
This closes the long-standing
# TODO: support for calibration panelsinopendm/multispectral.py.The implementation is fully native: panel metadata is parsed directly from
XMP as Micasense already handles QR Code panel reading and exposes results in MetaData.
How it works
opendm/photo.py): reads the panel XMP tagsCalibrationPicture,Albedo,ReflectArea,PanelSerialand exposesget_panel_albedo(),get_panel_region(),get_panel_serial(),is_calibration_picture(), andis_panel_image().stages/dataset.py+opendm/multispectral.py):panel captures are auto-detected, per-band irradiance is computed once
(
irradiance = mean_panel_radiance * π / albedo, robust median across panelcaptures), persisted to
panels.json, and the panel frames are excluded fromthe reconstruction (they are ground shots that would pollute SfM).
stages/run_opensfm.py): the per-band irradiance is loadedand passed into
dn_to_reflectance.compute_irradiancenow checks panelirradiance before the stored
HorizontalIrradiance, so it is actually usedon DLS cameras.
Fallback order per band: panel → stored HorizontalIrradiance → DLS estimate → 1.0.
New CLI options
--radiometric-calibration camera+panel--panel-reflectance— override panel albedo when metadata is missing;accepts a single float (e.g.
0.49) or per-band JSON(e.g.
'{"Red": 0.49, "Green": 0.49}').Robustness
camera+panelis selected.Test plan
parse_panel_reflectance(
tests/test_photo.py).albedo within tolerance.
--panel-reflectance 0.49override path.Notes / limitations
--rerun-from datasetif enablingcamera+panelon an already-loaded dataset.