static L regionOutline(BWImage_FastRegions regions, int iRegion) { new PtBuffer out; Pt p = regions.samplePixel(iRegion); int x = p.x, y = p.y; // move up until we're at the edge of the region // probably we don't actually need to do this because of the way // the image was scanned, but we'll do it anyway while (y > 0 && regions.inRegion(iRegion, x, y-1)) y--; // found our first outline pixel with background above out.add(pt(x, y)); ret out; }