danforthcenter / plantcv

Plant phenotyping with image analysis
Mozilla Public License 2.0
667 stars 265 forks source link

Hyperspectral first derivative #472

Open HaleySchuhl opened 5 years ago

HaleySchuhl commented 5 years ago

Figure out how to replicate the image analysis done here!

inoue2012.pdf

Additional context "Among various SIs, a simple index, RSI (D740, D522) using the first derivative (D) values at 740 nm and 522 nm, was found to be most accurate and robust for the assessment of canopy nitrogen content." The first derivative is a "technique used for eliminating background signals or noise and for resolving overlapping spectral features."

HaleySchuhl commented 5 years ago

In the paper, they use cubic spline interpolation at 3 nm and 10 nm intervals to get the reflectance spectra. This seems doable in python since there is a scipy function already (https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.interpolate.CubicSpline.html). The first derivative was calculated from these reflectance data. This and an approximation method (https://math.stackexchange.com/questions/304069/use-a-set-of-data-points-from-a-graph-to-find-a-derivative) are worth testing.

I'm imagining that this pcv.hyperspectral.analyze_derivative function could work similarly to the analyze_spectral function that is already on the hyperspectral sub-package branch in that it would save these derivative values with labels being the corresponding wavelength ranges (maybe the label is the middle of the given range for easier plotting). It's not clear to me why they chose two different intervals but maybe we could allow users to define the interval as a parameter since the range/resolution of the input hyperspectral data can be very different from user to user.

Downstream steps from taking the derivative is similar to other hyperspectral workflows. In the paper they tried using NDVI with D660 and D830 (rather than just the reflectance at 660 and 830) and RSI with (D740 / D522), which was the best. This means that the exctract_index function might need to also be able to handle the output from the derivative function.