

def _create_learning_image(domain, b):
    'Set up features for the classifier to be trained on'
    outputBands = _get_modis_learning_bands(domain, b)
    try:
        dem = domain.get_dem().image
        outputBands.addBands(dem)
    except AttributeError:
        pass
    try:
        try:
            skyboxSensor = domain.skybox
        except:
            skyboxSensor = domain.skybox_nir
        rgbBands = skyboxSensor.Red.addBands(skyboxSensor.Green).addBands(skyboxSensor.Blue)
        grayBand = rgbBands.select('Red').add(rgbBands.select('Green')).add(rgbBands.select('Blue')).divide(ee.Image(3.0)).uint16()
        edges = grayBand.convolve(ee.Kernel.laplacian8(normalize=True)).abs()
        texture = edges.convolve(ee.Kernel.square(3, 'pixels')).select(['Red'], ['Texture'])
        texture2Raw = grayBand.glcmTexture()
        bandList = safe_get_info(texture2Raw)['bands']
        bandName = [x['id'] for x in bandList if ('idm' in x['id'])]
        texture2 = texture2Raw.select(bandName).convolve(ee.Kernel.square(5, 'pixels'))
        skyboxBands = rgbBands.addBands(texture2)
        outputBands = outputBands.addBands(skyboxBands)
    except AttributeError:
        pass
    try:
        outputBands = outputBands.addBands(domain.skybox_nir.NIR)
    except AttributeError:
        pass
    return outputBands

dataset/ETHPy150Open nasa/CrisisMappingToolkit/cmt/modis/ee_classifiers.py _create_learning_image/original