ee.Kernel.fixed

Creates a Kernel.
Usage Returns
ee.Kernel.fixed( width , height , weights, x , y , normalize ) Kernel
Argument Type Details
width
Integer, default: -1 The width of the kernel in pixels.
height
Integer, default: -1 The height of the kernel in pixels.
weights
List A 2-D list of [height] x [width] values to use as the weights of the kernel.
x
Integer, default: -1 The location of the focus, as an offset from the left.
y
Integer, default: -1 The location of the focus, as an offset from the top.
normalize
Boolean, default: false Normalize the kernel values to sum to 1.

Examples

Code Editor (JavaScript)

 // 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] 
 */ 

Python setup

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

 import 
  
 ee 
 import 
  
 geemap.core 
  
 as 
  
 geemap 

Colab (Python)

 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] 
Create a Mobile Website
View Site in Mobile | Classic
Share by: