当前位置: 首页>>代码示例>>Java>>正文


Java RegionOfInterestConfig.setOpticalFlowNumFramesToEvent方法代码示例

本文整理汇总了Java中org.kurento.module.crowddetector.RegionOfInterestConfig.setOpticalFlowNumFramesToEvent方法的典型用法代码示例。如果您正苦于以下问题:Java RegionOfInterestConfig.setOpticalFlowNumFramesToEvent方法的具体用法?Java RegionOfInterestConfig.setOpticalFlowNumFramesToEvent怎么用?Java RegionOfInterestConfig.setOpticalFlowNumFramesToEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kurento.module.crowddetector.RegionOfInterestConfig的用法示例。


在下文中一共展示了RegionOfInterestConfig.setOpticalFlowNumFramesToEvent方法的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;
  }
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:55,代码来源:Pipeline.java

示例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;
  }
 
开发者ID:usmanullah,项目名称:kurento-testing,代码行数:43,代码来源:Pipeline.java

示例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;
  }
 
开发者ID:Kurento,项目名称:kurento-java,代码行数:43,代码来源:KmsPerformanceTest.java


注:本文中的org.kurento.module.crowddetector.RegionOfInterestConfig.setOpticalFlowNumFramesToEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。