1 #ifndef __MOBILE_OBJECT_2D_H__ 2 #define __MOBILE_OBJECT_2D_H__ 5 #include "trajectory.h" 11 #define MOBILE2D_DEBUG_DATA 12 #define MOBILE2D_DETAILS 13 #define FOR_SPREADSHEET_MOBILE2D 14 #define SHOW_BLOB2D_BUFFER 21 double prevCooling2D, sumCooling2D;
26 double XEstimated, sumRDX, sumRDVX;
27 double YEstimated, sumRDY, sumRDVY;
29 double WEstimated, sumRDW, sumRDVW;
30 double HEstimated, sumRDH, sumRDVH;
37 double W, RW, RDW, RCW, SDW;
38 double H, RH, RDH, RCH, SDH;
40 double VW, RDVW, RCVW, RVW, SDVW;
41 double VH, RDVH, RCVH, RVH, SDVH;
47 double X, SDX, RX, RDX, RCX;
48 double Y, SDY, RY, RDY, RCY;
50 double VX, SDVX, RVX, RDVX, RCVX;
51 double VY, SDVY, RVY, RDVY, RCVY;
58 double theta2D, SDtheta2D;
65 typedef QSharedPointer<MobileObject2D> SpMobileObject2D;
68 bool operator()(SpMobileObject2D mobile1, SpMobileObject2D mobile2);
72 bool operator()(SpMobileObject2D mobile1, SpMobileObject2D mobile2);
78 static double ONE_OVER_SQRT_2_TIMES_PI;
80 static QImage *m_pSegmentation;
82 static int m_currentTrackingBlobsNumber;
83 static double m_lambda;
84 static int m_blobsBufferSize;
85 static int m_trajectoryMaxSize;
86 static bool m_firstFrame;
87 static double m_SpatialCoherenceReliabilityThreshold;
88 static double m_SpatialCoherenceProbabilityThreshold;
89 static double m_DimensionalCoherenceReliabilityThreshold;
90 static double m_DimensionalCoherenceProbabilityThreshold;
91 static double m_MinimalHistoryProbability;
94 static double *secDiffSequence;
95 static double *secDiffToCurrent;
96 static double *coolingValue;
98 static double m_probabilityToEnsureMode;
100 static double *g_secDiffSequence;
101 static double *g_coolingValue;
102 static double *g_secDiffToCurrent;
103 static tracking2DimensionalData *g_t2DDimData;
104 static tracking2DSpatialData *g_t2DSpatialData;
105 static IncrementalExtraGeneralData2D *g_iGData;
106 static IncrementalExtra2DData *g_i2DData;
108 static double *g_newVisualSupport;
109 static DetectionProblemType *g_newDPFlags;
110 static int g_currentBufferSize;
111 static double zeroTolerance;
112 static double m_minimalTolerance;
113 static int m_pixelAcuity;
114 static double m_max2DSpeed;
115 static double m_reliableObjectLength;
118 unsigned long mobile_id;
119 unsigned long rmobile_id;
120 ObjectType best_type;
121 ObjectSubtype best_subtype;
134 int numberOfFramesNotSeen, numberOfFramesSinceFirstTimeSeen, numberOfFound;
135 int previousBufferSize;
136 int currentBufferSize;
138 double *visualSupport;
139 DetectionProblemType *dpFlags;
140 DetectionProblemType currentVisualState;
144 double RFoundSolutions, RVFoundSolutions;
150 tracking2DimensionalData t2DDimData;
151 tracking2DSpatialData t2DSpatialData;
153 IncrementalExtraGeneralData2D iGData;
154 IncrementalExtra2DData i2DData;
168 bool accepted_solution;
173 std::deque<int> currentlyMergedBlobs;
180 void initUsedBlobs();
181 void initInvolvedBlobs();
184 void insertNewBlob(
Blob *blob);
185 void insertNewBlob(
Blob *blob,
int lastMilliSecondsDifference);
188 void setMobileId(
unsigned long i_id);
189 void setRMobileId(
unsigned long i_id);
190 void setNewMobileFromBlob(
Blob *blob,
unsigned long mobile_id,
unsigned long rmobile_id);
191 void setNumberOfFramesNotSeen(
int num);
192 void incrementNumberOfFramesNotSeen();
193 void incrementNumberOfFramesSinceFirstTimeSeen();
194 void setGlobalProbability();
195 Blob *determineMostLikelyBlob();
197 unsigned long getMobileId();
198 unsigned long getRMobileId();
199 int getNumberOfFramesNotSeen();
200 int getNumberOfFramesSinceFirstTimeSeen();
201 double getGlobalProbability();
203 void getMobileTolerances(
double&,
double&);
206 static double coolingFunction(
double x);
207 static double NormalizeOrientation(
double);
208 static double minimalAngularDistance(
double alpha1,
double alpha2);
209 static double NormalizeVelocityAngle(
double);
211 void updateMobilePath(
Blob *blob);
212 void updateMobileData();
213 double DimensionalCoherenceReliability(
double sigma_dim,
double min,
double max);
216 friend std::ostream& operator<<(std::ostream&, SpMobileObject2D);
218 double dimensional2DReliability(
double blobW,
double blobH);
219 double position2DReliability(
double distance2D);
221 double get2DDistanceToFocalPoint(
Blob *blob);
223 double get2DDistanceToFocalPoint(
double X,
double Y);
224 bool mobile2DCoherenceIsAcceptable();
225 bool mobile2DVelocityCoherenceIsAcceptable();
227 void incorporateNewInformation();
231 void incrementalUpdateCooling(
int bufferSize);
232 void incrementalUpdateOrientation(
int bufferSize,
Shape3DData **
data, DetectionProblemType *dpFlags,
double *visualSupport);
233 void incrementalUpdate2DPosition(
int bufferSize,
Rectangle<int> *bboxesToAnalyze, DetectionProblemType *dpFlags,
double *visualSupport,
double maxDistanceFactor);
234 void incrementalUpdate2DDimensions(
int bufferSize,
Rectangle<int> *bboxesToAnalyze, DetectionProblemType *dpFlags,
double *visualSupport,
double maxDistanceFactor);
237 void getCurrentBoundingBoxForMobileKeepingSize(
Rectangle<int> *bbox);
241 bool mobileOutOfScene();
242 void generateFirstClassifiedSequence();
243 void generateMostCoherentSequence(std::deque<SpBlob>::iterator first_blob_it,
int newBufferSize,
int frame_index);
245 double probabilisticCoherenceReliability(
double data,
double mean,
double sigma,
double acuity);
246 double normalisedSigmaCoherenceReliability(
double sigma,
double acuity);
250 void setInitialNormalList(
Blob *current_blob);
Definition: MobileObject2D.h:71
Definition: MobileObject2D.h:67
Definition: MobileObject2D.h:36
Definition: MobileObject2D.h:75
Definition: MobileObject2D.h:46
Definition: trajectory.h:20
Definition: BackgroundRecLigth.h:20