-
Notifications
You must be signed in to change notification settings - Fork 11
Use Sensor Gain Adjustment for DJI sensors when calibration panels are not present/used #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a4c7354
c8d69c1
1231432
66788d5
1585925
49fa699
d4ba3f7
1b47d39
871a109
c392a2a
343a3d4
716c760
9c94563
feac621
abf81f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Build and Test Executables | ||
| on: | ||
| push: | ||
| branches-ignore: | ||
| [main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Build and Test Executables | ||
| runs-on: windows-2022 | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install dependencies | ||
| shell: pwsh | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pyinstaller | ||
| pip install . | ||
|
|
||
| - name: Build EXEs | ||
| shell: pwsh | ||
| run: | | ||
| pyinstaller correct_images_onefile.spec --noconfirm --clean | ||
| pyinstaller get_corrections_onefile.spec --noconfirm --clean | ||
|
|
||
| - name: Test EXEs | ||
| shell: pwsh | ||
| run: | | ||
| dist/ImageryCorrector.exe tests/6x_images --output_path dist/6x_images_test_output | ||
| dist/GetCorrectionsCsv.exe tests/6x_images --output_path dist/6x_images_test_output_csv | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -334,6 +334,9 @@ def get_sensitivity(row): | |
| ] | ||
| ) | ||
| return 1 / sensitivity | ||
| elif "drone-dji:SensorGainAdjustment" in xmp: | ||
| gain_adj = float(xmp["drone-dji:SensorGainAdjustment"]) | ||
| return gain_adj | ||
|
Comment on lines
+337
to
+339
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems good to me. I can't think of any case where we would have |
||
| else: | ||
| return 1 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,7 +89,8 @@ def apply_sensor_settings(image_df): | |
| # remove images that don't appear in every band | ||
| new_image_df = new_image_df[new_image_df.ID.isin(v.index[v.eq(band_count)])] | ||
| logger.info( | ||
| f"Skipping {images_before_filtering - len(new_image_df.index)} images because they don't have data for all bands" | ||
| "Skipping %s images because they don't have data for all bands", | ||
| images_before_filtering - len(new_image_df.index), | ||
|
Comment on lines
+92
to
+93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find f-strings a bit easier to read for most cases, but it really doesn't matter here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, for some reason the linter doesn't like using f strings with logger calls |
||
| ) | ||
|
|
||
| return new_image_df | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above, are these extra files (exiftool
cfgfiles) needed in both the onefile and dir version? I'd expect if it's needed in one it would be needed for the others?