Skip to content
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

[pull] master from OpenDroneMap:master #13

Merged
merged 2 commits into from
Mar 27, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed radiometric-calibration bug
  • Loading branch information
pierotofy committed Mar 27, 2020
commit 544baba9e4697e99336007e5671ba6fe232d542a
4 changes: 4 additions & 0 deletions opendm/multispectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def dn_to_radiance(photo, image):
"""

image = image.astype("float32")
if len(image.shape) != 3:
raise ValueError("Image should have shape length of 3 (got: %s)" % len(image.shape))

# Handle thermal bands (experimental)
if photo.band_name == 'LWIR':
Expand Down Expand Up @@ -50,11 +52,13 @@ def dn_to_radiance(photo, image):

if V is not None:
# vignette correction
V = np.repeat(V[:, :, np.newaxis], image.shape[2], axis=2)
image *= V

if exposure_time and a2 is not None and a3 is not None:
# row gradient correction
R = 1.0 / (1.0 + a2 * y / exposure_time - a3 * y)
R = np.repeat(R[:, :, np.newaxis], image.shape[2], axis=2)
image *= R

# Floor any negative radiances to zero (can happend due to noise around blackLevel)
Expand Down