ee.Kernel.fixed

Creates a Kernel.

UsageReturns
ee.Kernel.fixed(width, height, weights, x, y, normalize)Kernel
ArgumentTypeDetails
widthInteger, default: -1The width of the kernel in pixels.
heightInteger, default: -1The height of the kernel in pixels.
weightsListA 2-D list of [height] x [width] values to use as the weights of the kernel.
xInteger, default: -1The location of the focus, as an offset from the left.
yInteger, default: -1The location of the focus, as an offset from the top.
normalizeBoolean, default: falseNormalize the kernel values to sum to 1.

Examples

// Kernel weights.
var weights = [[4, 3, 2, 1, 2, 3, 4],
               [4, 3, 2, 1, 2, 3, 4],
               [4, 3, 2, 1, 2, 3, 4]];

print('A fixed kernel', ee.Kernel.fixed({weights: weights}));

/**
 * Output weights matrix
 *
 * [4, 3, 2, 1, 2, 3, 4]
 * [4, 3, 2, 1, 2, 3, 4]
 * [4, 3, 2, 1, 2, 3, 4]
 */

See the Python Environment page for information on the Python API and using geemap for interactive development.

import ee
import geemap.core as geemap
from pprint import pprint

weights = [[4, 3, 2, 1, 2, 3, 4],
           [4, 3, 2, 1, 2, 3, 4],
           [4, 3, 2, 1, 2, 3, 4]]

print('A fixed kernel:')
pprint(ee.Kernel.fixed(**{'weights': weights}).getInfo())

#  Output weights matrix

#  [4, 3, 2, 1, 2, 3, 4]
#  [4, 3, 2, 1, 2, 3, 4]
#  [4, 3, 2, 1, 2, 3, 4]