本文整理汇总了Java中org.kurento.module.crowddetector.RegionOfInterestConfig.setFluidityLevelMax方法的典型用法代码示例。如果您正苦于以下问题:Java RegionOfInterestConfig.setFluidityLevelMax方法的具体用法?Java RegionOfInterestConfig.setFluidityLevelMax怎么用?Java RegionOfInterestConfig.setFluidityLevelMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kurento.module.crowddetector.RegionOfInterestConfig
的用法示例。
在下文中一共展示了RegionOfInterestConfig.setFluidityLevelMax方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readRoisFromJson
import org.kurento.module.crowddetector.RegionOfInterestConfig; //导入方法依赖的package包/类
private static List<RegionOfInterest> readRoisFromJson(JsonArray loadedRois) {
List<RegionOfInterest> rois = new ArrayList<>();
for (int j = 0; j < loadedRois.size(); j++) {
JsonObject roi = (JsonObject) loadedRois.get(j);
JsonArray coordinates = (JsonArray) roi.get("points");
// create structure to configure crowddetector
List<RelativePoint> points = new ArrayList<>(coordinates.size());
for (int i = 0; i < coordinates.size(); i++) {
JsonObject coordinate = coordinates.get(i).getAsJsonObject();
float x = coordinate.getAsJsonPrimitive("x").getAsFloat();
float y = coordinate.getAsJsonPrimitive("y").getAsFloat();
if (x > 1) {
x = 1;
}
if (y > 1) {
y = 1;
}
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());
config.setSendOpticalFlowEvent(roi.getAsJsonPrimitive("sendOpticalFlowEvent").getAsBoolean());
config.setOpticalFlowNumFramesToEvent(
roi.getAsJsonPrimitive("opticalFlowNumFramesToEvent").getAsInt());
config.setOpticalFlowNumFramesToReset(
roi.getAsJsonPrimitive("opticalFlowNumFramesToReset").getAsInt());
config.setOpticalFlowAngleOffset(roi.getAsJsonPrimitive("opticalFlowAngleOffset").getAsInt());
rois.add(new RegionOfInterest(points, config, roi.getAsJsonPrimitive("id").getAsString()));
}
return rois;
}
示例2: getDummyRois
import org.kurento.module.crowddetector.RegionOfInterestConfig; //导入方法依赖的package包/类
private static List<RegionOfInterest> getDummyRois() {
List<RelativePoint> points = new ArrayList<>();
float x = 0;
float y = 0;
points.add(new RelativePoint(x, y));
x = 1;
y = 0;
points.add(new RelativePoint(x, y));
x = 1;
y = 1;
points.add(new RelativePoint(x, y));
x = 0;
y = 1;
points.add(new RelativePoint(x, y));
RegionOfInterestConfig config = new RegionOfInterestConfig();
config.setFluidityLevelMin(10);
config.setFluidityLevelMed(35);
config.setFluidityLevelMax(65);
config.setFluidityNumFramesToEvent(5);
config.setOccupancyLevelMin(10);
config.setOccupancyLevelMed(35);
config.setOccupancyLevelMax(65);
config.setOccupancyNumFramesToEvent(5);
config.setSendOpticalFlowEvent(false);
config.setOpticalFlowNumFramesToEvent(3);
config.setOpticalFlowNumFramesToReset(3);
config.setOpticalFlowAngleOffset(0);
List<RegionOfInterest> rois = new ArrayList<>();
rois.add(new RegionOfInterest(points, config, "dummyRoy"));
return rois;
}
示例3: getDummyRois
import org.kurento.module.crowddetector.RegionOfInterestConfig; //导入方法依赖的package包/类
private List<RegionOfInterest> getDummyRois() {
List<RelativePoint> points = new ArrayList<>();
float x = 0;
float y = 0;
points.add(new RelativePoint(x, y));
x = 1;
y = 0;
points.add(new RelativePoint(x, y));
x = 1;
y = 1;
points.add(new RelativePoint(x, y));
x = 0;
y = 1;
points.add(new RelativePoint(x, y));
RegionOfInterestConfig config = new RegionOfInterestConfig();
config.setFluidityLevelMin(10);
config.setFluidityLevelMed(35);
config.setFluidityLevelMax(65);
config.setFluidityNumFramesToEvent(5);
config.setOccupancyLevelMin(10);
config.setOccupancyLevelMed(35);
config.setOccupancyLevelMax(65);
config.setOccupancyNumFramesToEvent(5);
config.setSendOpticalFlowEvent(false);
config.setOpticalFlowNumFramesToEvent(3);
config.setOpticalFlowNumFramesToReset(3);
config.setOpticalFlowAngleOffset(0);
List<RegionOfInterest> rois = new ArrayList<>();
rois.add(new RegionOfInterest(points, config, "dummyRoy"));
return rois;
}