view include/Parameters.hpp @ 372:349eb1e09f45

Cleaned the methods/functions indicating if a point is in a polygon In general, shapely should be used, especially for lots of points: from shapely.geometry import Polygon, Point poly = Polygon(array([[0,0],[0,1],[1,1],[1,0]])) p = Point(0.5,0.5) poly.contains(p) -> returns True poly.contains(Point(-1,-1)) -> returns False You can convert a moving.Point to a shapely point: p = moving.Point(1,2) p.asShapely() returns the equivalent shapely point If you have several points to test, use moving.pointsInPolygon(points, polygon) where points are moving.Point and polygon is a shapely polygon.
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 16 Jul 2013 17:00:17 -0400
parents 8672c101bfec
children c389fae9689a
line wrap: on
line source

#ifndef PARAMETERS_HPP
#define PARAMETERS_HPP

/// \todo Class for parameters, with utilities to save and load from configuration files

#include <string>

namespace boost{
  namespace program_options {
    class options_description;
    class variables_map;
  }
}

struct KLTFeatureTrackingParameters {
  bool trackFeatures;
  bool groupFeatures;

  std::string videoFilename;
  std::string databaseFilename;
  std::string homographyFilename;
  std::string maskFilename;
  bool loadFeatures;
  bool display;
  float videoFPS;
  // int measurementPrecision;
  unsigned int frame1;
  int nFrames;
  // feature tracking
  int maxNFeatures;
  float featureQuality;
  float minFeatureDistanceKLT;
  int windowSize;
  bool useHarrisDetector;
  float k;
  int pyramidLevel;
  unsigned int nDisplacements;
  float minFeatureDisplacement;
  float accelerationBound;
  float deviationBound;
  int nFramesSmoothing;
  //int nFramesVelocity;
  int maxNumberTrackingIterations;
  float minTrackingError;
  unsigned int minFeatureTime;
  float mmConnectionDistance;
  float mmSegmentationDistance;
  float maxDistance;
  float minVelocityCosine;
  float minNFeaturesPerGroup;
  // safety analysis
  float maxPredictedSpeed;
  float predictionTimeHorizon;
  float collisionDistance;
  bool crossingZones;
  std::string predictionMethod;
  int nPredictedTrajectories;
  float minAcceleration;
  float maxAcceleration;
  float maxSteering;
  bool useFeaturesForPrediction;

  std::string parameterDescription;

  KLTFeatureTrackingParameters(const int argc, char* argv[]);

  //KLTFeatureTrackingParameters(bool loadFeatures, std::string videoFilename, int videoFPS, int measurementPrecision, int frame1, int nFrames, int maxNFeatures, float featureQuality, float minFeatureDistanceKLT, int windowSize, int pyramidLevel, int nDisplacements, float minFeatureDisplacement, float accelerationBound, float deviationBound, int nFramesSmoothing, int nFramesVelocity, int maxNumberTrackingIterations, float minTrackingError, int minFeatureTime, float mmConnectionDistance, float mmSegmentationDistance, float maxDistance, float minVelocityCosine, int minNFeaturesPerGroup);

  std::string getParameterDescription(boost::program_options::options_description& options, const boost::program_options::variables_map& vm, const std::string& separator = " ") const;
};

#endif