.getAsFloat();
points.add(new RelativePoint(x, y));
}
RegionOfInterestConfig config = new RegionOfInterestConfig();
config.setFluidityLevelMin(roi.getAsJsonPrimitive(
"fluidityLevelMin").getAsInt());
config.setFluidityLevelMed(roi.getAsJsonPrimitive(
"fluidityLevelMed").getAsInt());
config.setFluidityLevelMax(roi.getAsJsonPrimitive(
"fluidityLevelMax").getAsInt());
config.setFluidityNumFramesToEvent(roi.getAsJsonPrimitive(
"fluidityNumFramesToEvent").getAsInt());
config.setOccupancyLevelMin(roi.getAsJsonPrimitive(
"occupancyLevelMin").getAsInt());
config.setOccupancyLevelMed(roi.getAsJsonPrimitive(
"occupancyLevelMed").getAsInt());
config.setOccupancyLevelMax(roi.getAsJsonPrimitive(
"occupancyLevelMax").getAsInt());
config.setOccupancyNumFramesToEvent(roi.getAsJsonPrimitive(
"occupancyNumFramesToEvent").getAsInt());
if (roi.getAsJsonPrimitive("sendOpticalFlowEvent")
.getAsInt() == 0) {
config.setSendOpticalFlowEvent(false);
} else {
config.setSendOpticalFlowEvent(true);
}
config.setOpticalFlowNumFramesToEvent(roi
.getAsJsonPrimitive("opticalFlowNumFramesToEvents")
.getAsInt());
config.setOpticalFlowNumFramesToReset(roi
.getAsJsonPrimitive("opticalFlowNumFramesToReset")
.getAsInt());
config.setOpticalFlowAngleOffset(roi.getAsJsonPrimitive(
"opticalFlowAngleOffset").getAsInt());
getLogger().info(config.toString());
rois.add(new RegionOfInterest(points, config, roi
.getAsJsonPrimitive("id").getAsString()));
}
crowdDetector = mediaPipeline.newCrowdDetectorFilter(rois)