當前位置: 首頁>>代碼示例>>Java>>正文


Java RegionOfInterestConfig類代碼示例

本文整理匯總了Java中org.kurento.module.crowddetector.RegionOfInterestConfig的典型用法代碼示例。如果您正苦於以下問題:Java RegionOfInterestConfig類的具體用法?Java RegionOfInterestConfig怎麽用?Java RegionOfInterestConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RegionOfInterestConfig類屬於org.kurento.module.crowddetector包,在下文中一共展示了RegionOfInterestConfig類的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類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。