0

I am trying to pan sharpen "Planet SkySat Public Ortho Imagery, Multispectral" image but it has been returning blank tiles. What is the problem?

var imageCollection = ee.ImageCollection('SKYSAT/GEN-A/PUBLIC/ORTHO/MULTISPECTRAL');
var image = imageCollection.median();

var vis = {
  "opacity":1,
  "bands": ["N","G","B"],
  "min":132.7061786684951,
  "max":3655.0445459691864,
  "gamma":1
};

print (image,"original image")
Map.addLayer(image,vis,'Original Image')

// Convert the RGB bands to the HSV color space.
var hsv = image.select(['N', 'G', 'B']).rgbToHsv();
print (hsv,"HSV");


// Swap in the panchromatic band and convert back to RGB. P is panchromatic band
//ee.Image.cat concatenates the images 
var sharpened = ee.Image.cat([
  hsv.select('hue'), hsv.select('saturation'), image.select('P')]).hsvToRgb();
print(sharpened,'sharpened')

var visPan = {
  "bands":["red","blue","green"],
  "min":0.5, 
  "max":0.4, 
  "gamma":0.5
}

Map.addLayer(sharpened,{},'pan-sharpened');

Map.setCenter(85.456, 27.345,8);
Map.setOptions('SATELLITE')
3
  • Thanks a lot. It worked. I changed this var hsv = image.select(['R', 'G', 'B']).unitScale(16,62000).rgbToHsv(); for testing purpose. Sorry for repetitive question as I am new to GEE. How can I have values of (min,max) to feed in .unitScale(min,max)?
    – polymathic
    Commented Jun 6, 2021 at 9:11
  • gis.stackexchange.com/a/306964/2856
    – user2856
    Commented Jun 6, 2021 at 10:08
  • Thank you @user2856
    – polymathic
    Commented Jun 8, 2021 at 16:23

1 Answer 1

1

ee.Image.rgbToHsv expects a 3 band image in the range [0, 1]. The Skysat imagery is not in this range (see estimated min/max values). Use ee.Image.unitScale to rescale/normalise to a 0-1 range.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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