srecord noeq CountHolesInRegion(IImageRegion region) { int holes; int get() { if (region == null) ret 0; var borderWalker = new RegionBorder_innerPoints_v2(region); borderWalker.onNewTrace(isHole -> { if (isHole) holes++; }); borderWalker.run(); ret holes; } }