Search in sources :

Example 1 with BinaryRegion

use of imagingbook.pub.regions.BinaryRegion in project imagingbook-common by imagingbook.

the class RegionContourSegmentation method attachOuterContours.

// ------------------------------------------------------------------------------
private void attachOuterContours() {
    for (Contour.Outer c : outerContours) {
        int label = c.getLabel();
        BinaryRegion reg = getRegion(label);
        if (reg == null) {
            IJ.log("Error: Could not associate outer contour with label " + label);
        } else {
            reg.setOuterContour(c);
        }
    }
}
Also used : Contour(imagingbook.pub.regions.Contour) BinaryRegion(imagingbook.pub.regions.BinaryRegion)

Example 2 with BinaryRegion

use of imagingbook.pub.regions.BinaryRegion in project imagingbook-common by imagingbook.

the class RegionContourSegmentationTest method findFirstRegionWithHole.

private static int findFirstRegionWithHole(List<BinaryRegion> regions) {
    int i = 0;
    for (BinaryRegion r : regions) {
        List<Contour> ics = r.getInnerContours();
        if (ics != null && !ics.isEmpty()) {
            return i;
        }
        i = i + 1;
    }
    return -1;
}
Also used : Contour(imagingbook.pub.regions.Contour) BinaryRegion(imagingbook.pub.regions.BinaryRegion)

Aggregations

BinaryRegion (imagingbook.pub.regions.BinaryRegion)2 Contour (imagingbook.pub.regions.Contour)2