can anyone help me with the below code I am some wearied output..don' know what exactly to do...
Also, can someone tell me that how to load an image collection like ImageCollection('?(asking about this)') and from the image collection how to know which image is where with name.
I am working on linux and using python.
import ee
ee.Initialize()
"""landsat5Toa = ee.ImageCollection('LC80150062013111LGN01').filterDate('2014-3-25').select('B[1]')"""
img = ee.Image('LC80150062013111LGN01').select('B1').unitScale(0, 255)
meanReducer = ee.Reducer.mean()
sigmaReducer = ee.Reducer.stdDev()
region = ee.Geometry.Rectangle(77.00133,-51.30404,74.69582,-41.38993 )
scale = 10000
mean = img.reduceRegion(meanReducer, region, scale)
sigma = img.reduceRegion(sigmaReducer, region, scale)
"""mean = landsat5Toa.get('bands')"""
def stretch(img, mean, sigma):
return ee.Image(0).expression(
'((img - mean) / (sigma * 3)) + 0.5', {
'img': img,
'mean': ee.Image.constant(mean),
'sigma': ee.Image.constant(sigma)
})
print(mean.getInfo())
print(sigma.getInfo())
I dont know where I am haveing a problem.