ee.Kernel.inverse

แสดงผลเคอร์เนลที่มีการกลับค่าถ่วงน้ำหนักแต่ละรายการแบบคูณ น้ำหนักที่มีค่าเป็น 0 จะไม่กลับด้านและยังคงเป็น 0

การใช้งานการคืนสินค้า
Kernel.inverse()เคอร์เนล
อาร์กิวเมนต์ประเภทรายละเอียด
ดังนี้ kernelเคอร์เนลเคอร์เนลที่จะกลับรายการ

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (JavaScript)

var sobelKernel = ee.Kernel.sobel();
print(sobelKernel);

/**
 * Output weights matrix
 *
 * [-1, 0, 1]
 * [-2, 0, 2]
 * [-1, 0, 1]
 */

print('Inverse of Sobel kernel weights', sobelKernel.inverse());

/**
 * [-1.0, 0.0, 1.0]
 * [-0.5, 0.0, 0.5]
 * [-1.0, 0.0, 1.0]
 */

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

import ee
import geemap.core as geemap

Colab (Python)

from pprint import pprint

sobel_kernel = ee.Kernel.sobel()
pprint(sobel_kernel.getInfo())

# Output weights matrix

#  [-1, 0, 1]
#  [-2, 0, 2]
#  [-1, 0, 1]

print('Inverse of Sobel kernel weights:')
pprint(sobel_kernel.inverse().getInfo())

#  [-1.0, 0.0, 1.0]
#  [-0.5, 0.0, 0.5]
#  [-1.0, 0.0, 1.0]