Trajectory Outlier Detection Library
 All Classes Functions Variables Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
COutlierDetector Class Reference

A high-level class to perform the outlier detection. More...

#include <OutlierDetector.h>

Public Member Functions

 COutlierDetector ()
 Default constructor.
 
 COutlierDetector (TrajData *data)
 Constructor that accepts data.
 
bool ResetOutlierDetector ()
 Resets the outlier detector object. More...
 
bool PartitionTrajectory ()
 Partitions the trajectories in the data. More...
 
bool DetectOutlier ()
 Finds outliers and stores them in the data member. More...
 

Public Attributes

TrajDatam_data
 

Private Member Functions

bool FindOptimalPartition (CTrajectory *pTrajectory)
 Finds optimal partitioning of a trajectory. More...
 
bool StoreTrajectoryPartitionIntoIndex ()
 Saves the trajectory partitioning and precomputes some calculations (such as distances)
 
bool CheckOutlyingProportion (CTrajectory *pTrajectory, float minProportion)
 Checks if the trajectory contains a significant portion of outlying partitions.
 
bool GenerateAndSetupOutlier (CTrajectory *pTrajectory, int outlierId)
 Marks the given trajectory as an outlier in the data member. More...
 
int ComputeModelCost (CTrajectory *pTrajectory, int startPIndex, int endPIndex)
 Measures the model cost of using a partition to represent part of a trajectory. More...
 
int ComputeEncodingCost (CTrajectory *pTrajectory, int startPIndex, int endPIndex)
 Measures the encoding cost of using a partition to represent part of a trajectory. More...
 
float MeasurePerpendicularDistance (CMDPoint *s1, CMDPoint *e1, CMDPoint *s2, CMDPoint *e2)
 Measures the perpendicular distance between two line segments (see paper for definition of perpendicular distance)
 
float MeasureDistanceFromPointToLineSegment (CMDPoint *s, CMDPoint *e, CMDPoint *p)
 Measures the distance between a point and a line segment.
 
float MeasureDistanceFromPointToPoint (CMDPoint *point1, CMDPoint *point2)
 Measures the distance between two points.
 
float ComputeVectorLength (CMDPoint *vector)
 Computes the length of a vector.
 
float ComputeInnerProduct (CMDPoint *vector1, CMDPoint *vector2)
 Computes the inner product between two vectors.
 
float MeasureAngleDisntance (CMDPoint *s1, CMDPoint *e1, CMDPoint *s2, CMDPoint *e2)
 Measures the angle distance between two line segments (see paper for definition of angle distance)
 
float ComputeDistanceBetweenTwoLineSegments (CMDPoint *startPoint1, CMDPoint *endPoint1, CMDPoint *startPoint2, CMDPoint *endPoint2)
 Computes the weighted distance between two line segments from component distances (see paper for definition of distance)
 
void ComputeDistanceBetweenTwoLineSegments (CMDPoint *startPoint1, CMDPoint *endPoint1, CMDPoint *startPoint2, CMDPoint *endPoint2, float *distanceVector)
 Measures the perpendicular distance between two line segments (see paper for definition of perpendicular distance) and stores the result in distanceVector.
 
void SubComputeDistanceBetweenTwoLineSegments (CMDPoint *startPoint1, CMDPoint *endPoint1, CMDPoint *startPoint2, CMDPoint *endPoint2, float &perpendicularDistance, float &parallelDistance, float &angleDistance)
 Measures component distances and stores them in the variables perpendicularDistance, parallelDistance, and angleDistance.
 

Private Attributes

int m_nTotalLineSegments
 
vector< IntIntPair > m_idArray
 
vector< PointPointPair > m_lineSegmentArray
 
vector< FloatArray > m_distanceIndex
 
FloatArray m_lengthArray
 
vector< PartitionInfo * > m_partitionInfoArray
 
CMDPoint m_vector1
 
CMDPoint m_vector2
 
CMDPoint m_projectionPoint
 
float m_coefficient
 
float m_coefficient1
 
float m_coefficient2
 
PartitionInfo m_partitionInfo
 
float m_distance1
 
float m_distance2
 
float m_theta
 
float m_cosTheta
 
float m_lowerBoundPerp
 
float m_lowerBoundPara
 
float m_lowerBoundAngle
 
float m_upperBoundPerp
 
float m_upperBoundPara
 
float m_upperBoundAngle
 
map< IntIntPair, int > m_closePartitionArrayIndexMap
 
vector< vector< IntIntPair > > m_closePartitionArray
 
map< IntIntPair, float > m_finePartitionLengthMap
 
map< IntIntPair, int > m_coarsePartitionIdMap
 

Detailed Description

A high-level class to perform the outlier detection.

Mainly does management of the outlier detection (prunining of partitions for optimization, flagging trajectories as outliers, etc.) Much of the actual computation for outlier detection occurs in CDistanceOutlier.

Member Function Documentation

int COutlierDetector::ComputeEncodingCost ( CTrajectory pTrajectory,
int  startPIndex,
int  endPIndex 
)
private

Measures the encoding cost of using a partition to represent part of a trajectory.

In the MDL description of the paper this is known as L(D|H). It is the distance between the original trajectory and the partition representation.

Parameters
[in]pTrajectorythe trajectory that is being partitioned
[in]startPIndexthe index of the staring point of the partition
[in]endPIndexthe index of the ending point of the partition
int COutlierDetector::ComputeModelCost ( CTrajectory pTrajectory,
int  startPIndex,
int  endPIndex 
)
private

Measures the model cost of using a partition to represent part of a trajectory.

In the MDL description of the paper this is known as L(H). It is the length of the partition.

Parameters
[in]pTrajectorythe trajectory that is being partitioned
[in]startPIndexthe index of the staring point of the partition
[in]endPIndexthe index of the ending point of the partition
bool COutlierDetector::DetectOutlier ( )

Finds outliers and stores them in the data member.

Finds outliers in the data that is contained in the m_data field of the object. The outlying trajectories are stored in the m_outlierList member of the supplied data.

Returns
Successful or not.
bool COutlierDetector::FindOptimalPartition ( CTrajectory pTrajectory)
private

Finds optimal partitioning of a trajectory.

Consults PARTITION_PRUNING_OPTIMIZATION to determine if the optimizations to the two-level partitioning should be used.

Parameters
[in]pTrajectorythe trajectory to partition
bool COutlierDetector::GenerateAndSetupOutlier ( CTrajectory pTrajectory,
int  outlierId 
)
private

Marks the given trajectory as an outlier in the data member.

Returns
Successful or not.
bool COutlierDetector::PartitionTrajectory ( )

Partitions the trajectories in the data.

Consults parameter USE_CONVENTIONAL_PARTITONING to determine whether or not to use two-level partitioning scheme

bool COutlierDetector::ResetOutlierDetector ( )

Resets the outlier detector object.

Clears all of the internal arrays and resets the counters. Does not clear the trajectory data.

Returns
Successful or not

The documentation for this class was generated from the following files: