2

I am currently trying to use pan sharpening on Landsat 8 composites with Google Earth Engine. What I did is simply create a composite from an image collection as described in the documentation:

collection = ee.ImageCollection('LANDSAT/LC08/C01/T1').filterDate('2015-01-01', '2015-12-31')
custom_composite = ee.Algorithms.Landsat.simpleComposite(collection=collection,
                                                             percentile=75,
                                                             cloudScoreRange=5)

map_sharpened = folium.Map(location=[37.76664, -122.44829], zoom_start=13)


map_sharpened.add_ee_layer(custom_composite, {
    'bands': ['B4', 'B3', 'B2'], 'max': 128, 'gamma': [1.1, 1.1, 1]}, 'rgb')
display(map_sharpened)

This works as expected. Next, I want to use pan sharpening on my composite. I am basically following the example in the Earth Engine documentation (https://developers.google.com/earth-engine/guides/image_transforms) with the exception that I use a composite instead of one specific image. However, when I try to display the new layer, I only get a white map.

hsv = custom_composite.select(['B4', 'B3', 'B2']).rgbToHsv()
sharpened = ee.Image.cat(
    [hsv.select('hue'),
     hsv.select('saturation'),
     custom_composite.select('B8')]).hsvToRgb()

map_sharpened.add_ee_layer(sharpened, {
    'min': 0, 'max': 0.25, 'gamma': [1.3, 1.3, 1.3]}, 'pan-sharpened')
map_sharpened.add_child(folium.LayerControl())
map_sharpened

1 Answer 1

1

rgbtohsv and hsvtorgb expect normalized inputs (0 to 1). Your simpleComposite isn't normalized. Add asFloat=True to simpleComposite to get normalized values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.