ee.Image.connectedPixelCount

Generate an image where each pixel contains the number of 4- or 8-connected neighbors (including itself).

UsageReturns
Image.connectedPixelCount(maxSize, eightConnected)Image
ArgumentTypeDetails
this: inputImage

The input image.

maxSizeInteger, default: 100

The maximum size of the neighborhood in pixels.

eightConnectedBoolean, default: true

Whether to use 8-connected rather 4-connected rules.

Examples

JavaScript

// Your example goes here!

Python

# Your example goes here!