Connected Pixel Count is one of the ways where the concept of the Minimum Mapping Unit (MMU) can be applied. Basically, the connected pixel count gives the image with every pixel containing the information on the number of the connected neighbors including the pixel in context. The neighbors can be 4- or 8-connected neighbors, and the connected pixel can span in any direction.
connected-pixel-count-docs.png
The first parameter with the function connectedPixelCount is the maximum size the pixel can crawl in any direction from the pixel in question, and the second parameter is whether we are interested in eight connected neighbors or not. If so, true for this parameter, else false.

A simple example demonstrating this can be found below.

var tcc = ee.ImageCollection('projects/servir-mekong/UMD/tree_canopy');
tcc = tcc.filterDate('2018-01-01', '2018-12-31').first();
tcc = tcc.updateMask(tcc.gt(80));

Map.addLayer(tcc, {palette: 'blue'}, 'tcc');

var mmu = 5;

var connectedPixels = tcc.connectedPixelCount(mmu, false);
connectedPixels = connectedPixels.updateMask(connectedPixels.gte(mmu));
Map.addLayer(connectedPixels, {palette: 'red'}, 'connectedPixels');

var connectedPixels = tcc.connectedPixelCount(mmu+5, false);
connectedPixels = connectedPixels.updateMask(connectedPixels.gte(mmu+5));
Map.addLayer(connectedPixels, {palette: 'orange'}, 'connectedPixels1');