Exemplo n.º 1
0
// Get all positions (vertices) from XMarkerList
PositionsVector getAllPositionsFromXMarkerList(const ml::XMarkerList positionsList, const std::string allowedPositionTypes, double pointSize)
{
  PositionsVector result;
  
  PositionStruct newPosition;

  StringVector allowedPositionTypesVector = stringSplit(allowedPositionTypes, ",", false);

  size_t positionsListLength = positionsList.size();

  for (int i = 0; i < positionsListLength; i++)
  {
    ml::XMarker thisPosition = positionsList[i];

    // If thisPoint is of allowed type
    if (  ("all" == allowedPositionTypes) || ( std::find(allowedPositionTypesVector.begin(), allowedPositionTypesVector.end(), intToString(thisPosition.type)) != allowedPositionTypesVector.end() )  )
    {
      newPosition.position.x = thisPosition.x();
      newPosition.position.y = thisPosition.y();
      newPosition.position.z = thisPosition.z();
      newPosition.color      = Vector3(0);       // Not defined by XMarkerList
      newPosition.alpha      = 1;                // Not defined by XMarkerList
      newPosition.size       = pointSize;

      result.push_back(newPosition);
    }

  }
  
  return result;
}
 TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0)
 {
     lastPositions.push_back(rect);
     id=getNextId();
 };