-
Notifications
You must be signed in to change notification settings - Fork 265
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
How to handle uint8/[0,255] format HSI? #1599
Comments
I think it makes more sense in I guess the only argument against needless conversion is the floating-point error, but I guess it's negligible for these applications, right? |
Here is a sample image from the RVS Camera |
Thank you @rayn-alex this is super helpful. And my apologies for my slower response. I would agree that handling various datatypes as soon as possible makes the most sense, and we can evaluate if the decimal accuracy has an impact practically on results. How do you currently convert your images into a "plantcv friendly datatype" ? |
No worries. Just like this: spectral_data = readimage(filename=img_file, mode='envi')
spectral_data.array_data = spectral_data.array_data.astype("float32") # required for further calculations
if spectral_data.d_type == np.uint8: # only convert if data seems to be uint8
spectral_data.array_data = spectral_data.array_data / 255 # convert 0-255 (orig.) to 0-1 range
|
Start a discussion about anything you would like
So far plantcv has added support for a handful of different hyper/multispectral image formats (#972, #956, #781) and @rayn-alex brought up a formatting incompatibility that could make sense to handle automatically.
This sounds like a good argument to cast
Spectral_data
duringread_data
, or even inside_find_closest
/ other ideas ??The text was updated successfully, but these errors were encountered: