use of org.twak.utils.streams.InAxDouble in project chordatlas by twak.
the class Regularizer method augmentWithTween.
private List<MiniFacade> augmentWithTween(List<MiniFacade> in, MegaFeatures megaFeatures) {
List<MiniFacade> out = new ArrayList<>(in);
if (megaFeatures == null)
return out;
if (in.isEmpty()) {
for (ImageFeatures iff : megaFeatures.features) for (MiniFacade mf : iff.miniFacades) if (lt - 3 < mf.left && mf.right() < rt + 3)
out.add(mf);
return out;
}
MegaFeatures mf = in.get(0).imageFeatures.mega;
double[] range = in.stream().flatMap(m -> Streamz.stream(m.left, m.left + m.width)).collect(new InAxDouble());
for (ImageFeatures imf : mf.features) for (MiniFacade mf2 : imf.miniFacades) if (mf2.left > range[0] && mf2.left + mf2.width < range[1] && !out.contains(mf2))
out.add(mf2);
return out;
}
Aggregations