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);
}
}
}
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;
}
Aggregations