Skip to content

Commit

Permalink
Merge pull request #216 from micasense/bug/remove-normalization
Browse files Browse the repository at this point in the history
Remove stack normalization when writing stack to disk
  • Loading branch information
sebc06 authored Mar 27, 2024
2 parents 90fbede + 0c9a509 commit c47410f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions micasense/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,9 @@ def save_capture_as_stack(self, outfilename, sort_by_wavelength=False, photometr

eo_count = len(eo_list)

multispec_min = np.min(np.percentile(aligned_cap[:, :, 1:eo_count].flatten(), 0.01))
multispec_max = np.max(np.percentile(aligned_cap[:, :, 1:eo_count].flatten(), 99.99))

for outband_count, inband in enumerate(eo_list):
outband = outRaster.GetRasterBand(outband_count + 1)
outdata = imageutils.normalize(aligned_cap[:, :, inband], multispec_min, multispec_max)
outdata = self.__aligned_capture[:, :, inband]
outdata[outdata < 0] = 0
outdata[outdata > 2] = 2 # limit reflectance data to 200% to allow some specular reflections
outdata = outdata * 32767 # scale reflectance images so 100% = 32768
Expand Down

0 comments on commit c47410f

Please sign in to comment.