Lab 5: Multispectral Image Issues #291
Unanswered
haydenkrushel
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am having the same issues as this previous question. To quickly rephrase what was stated; the multispectral image (https://github.com/opengeos/datasets/releases/download/raster/cog.tif) has only 4 bands, but band 5 is needed for the NDWI calculation in exercise 4. Since this question has been asked, band names and numbers have been added to the lab, with band 5 being NIR. But when I try to access band 5, I am met with the following error:
IndexError: band index 5 out of range (not in (1, 2, 3, 4))I also have another issue with the multispectral image. Exercise 2 asks you to combine the RGB bands to create a composite image. When doing this, using the code from section 17.5.4.2 in the textbook, my resulting image is completely white. I'm unsure why the code, when altered for this dataset, produces a completely white image instead of an RGB color composite as in the textbook example.
What I believe to be a possible cause are the pixel values in each band. The pixel values for the multispectral image are as follows:
Red Band - Min: 336.5 Max: 4269.0 Green Band - Min: 913.5 Max: 2083.0 Blue Band - Min: 735.0 Max: 1960.0I believe the code
.clip(0, 1)from the example code contributed to the white image, and when removed, I get the error:WARNING:matplotlib.image:Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers). Got range [336.5..4269.0].It seems to me that the pixel range in the multispectral image is much too high, but I'm unsure what to do about it.
Please let me know what to do so I can create a composite RGB image, access the NIR band, and complete the rest of the exercises with no issue.
Thank you!
All reactions