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

Obtaining reflectance values taking into account also DLS #226

Open
MarcoVuerich opened this issue Sep 4, 2024 · 0 comments
Open

Obtaining reflectance values taking into account also DLS #226

MarcoVuerich opened this issue Sep 4, 2024 · 0 comments

Comments

@MarcoVuerich
Copy link

Hello, I'm using a RedEdge MX as a ground sensor and I would like to take into account also DLS for reflectance calibration.

Citing tutorial n. 3
"we assume a constant irradiance (over time) and a ratio of direct to diffuse irradiance of 6:1. These assumptions only hold approximately, and only for clear sky. Cloud cover can lead to dramatically different results"
and also
"If your intent is to simply use this code to correct your data, you can skip this section and access pose-corrected DLS data through the capture.dls_irradiance() method".

My questions are: does the function capture.dls_irradiance() give me a value that is not affected by the choice of the ratio of direct to diffuse irradiance? In other words, the values that this function gives me, can be used directly in the subsequent part of code, that I report her below:

panel_radiances = np.array(cap.panel_radiance())
irr_from_panel = math.pi * panel_radiances / panel_reflectance_by_band
dls_correction = irr_from_panel/dls_irradiances
cap.plot_undistorted_reflectance(dls_irradiances*dls_correction)

For the correcting calibration of reflectance of the other captures should I go with:

dls_irradiances=capture_to_analyze.dls_irradiance()
capture_to_analyze.undistorted_reflectance(dls_irradiances*dls_correction)

Moreover, every time I tried tutorial n.3 in this part of code

import numpy as np
import micasense.dls as dls

import os, glob
import micasense.capture as capture

images_path = os.path.join('.','data','0000SET','000')
image_names = glob.glob(os.path.join(images_path,'IMG_0000_*.tif'))
cap = capture.Capture.from_filelist(image_names)
# set panel corners manually if zbar is not installed
panelCorners = [[[809,613],[648,615],[646,454],[808,452]],
                [[772,623],[613,625],[610,464],[770,462]],
                [[771,651],[611,653],[610,492],[770,490]],
                [[829,658],[668,659],[668,496],[829,496]],
                [[807,632],[648,634],[645,473],[805,471]]]

cap.set_panelCorners(panelCorners)
panel_radiances = np.array(cap.panel_radiance())

gave me this error

  Cell In[285], line 1
    np.array(panelCap.panel_radiance())

  File ~\anaconda3\envs\micasense\lib\site-packages\micasense\capture.py:396 in panel_radiance
    mean, _, _, _ = p.radiance()

  File ~\anaconda3\envs\micasense\lib\site-packages\micasense\panel.py:268 in radiance
    return self.region_stats(radiance_img,

  File ~\anaconda3\envs\micasense\lib\site-packages\micasense\panel.py:239 in region_stats
    rev_panel_pts = np.fliplr(region)  # skimage and opencv coords are reversed

  File <__array_function__ internals>:200 in fliplr

  File ~\anaconda3\envs\micasense\lib\site-packages\numpy\lib\twodim_base.py:98 in fliplr
    raise ValueError("Input must be >= 2-d.")

ValueError: Input must be >= 2-d.

What am I doing wrong? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant