Skip to content

Commit 67dc3aa

Browse files
committed
Some small improvements
1 parent 48868f2 commit 67dc3aa

4 files changed

Lines changed: 5 additions & 8 deletions

File tree

cars_counting/CarsCounting.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ void CarsCounting::DrawTrack(cv::Mat frame,
230230
///
231231
bool CarsCounting::InitTracker(cv::UMat frame)
232232
{
233-
m_useLocalTracking = false;
234-
235233
m_minObjWidth = frame.cols / 50;
236234

237235
const int minStaticTime = 5;
@@ -260,7 +258,7 @@ bool CarsCounting::InitTracker(cv::UMat frame)
260258
settings.m_matchType = tracking::MatchHungrian;
261259
settings.m_dt = 0.5f; // Delta time for Kalman filter
262260
settings.m_accelNoiseMag = 0.5f; // Accel noise magnitude for Kalman filter
263-
settings.m_distThres = frame.rows / 20; // Distance threshold between region and object on two frames
261+
settings.m_distThres = frame.rows / 15; // Distance threshold between region and object on two frames
264262

265263
settings.m_useAbandonedDetection = false;
266264
if (settings.m_useAbandonedDetection)

cars_counting/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int main(int argc, char** argv)
4141

4242
CarsCounting cars_counting(parser);
4343

44-
cars_counting.AddLine(RoadLine(cv::Point2f(0.15f, 0.6f), cv::Point2f(0.75f, 0.6f), 0));
44+
cars_counting.AddLine(RoadLine(cv::Point2f(0.2f, 0.5f), cv::Point2f(0.95f, 0.6f), 0));
4545

4646
cars_counting.Process();
4747

src/Tracker/Ctracker.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ void CTracker::UpdateHungrian(
115115
}
116116
}
117117
break;
118-
119-
//case tracking::DistLines:
120-
//break;
121118
}
122119
// -----------------------------------
123120
// Solving assignment problem (tracks and predictions of Kalman filter)

src/Tracker/track.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ void CTrack::RectUpdate(
352352
cv::Rect2d lastRect(m_predictionRect.x - roiRect.x, m_predictionRect.y - roiRect.y, m_predictionRect.width, m_predictionRect.height);
353353
if (m_staticFrame.empty())
354354
{
355-
lastRect = cv::Rect2d(m_predictionRect.x - roiRect.x, m_predictionRect.y - roiRect.y, m_predictionRect.width, m_predictionRect.height);
355+
int dx = 1;//m_predictionRect.width / 8;
356+
int dy = 1;//m_predictionRect.height / 8;
357+
lastRect = cv::Rect2d(m_predictionRect.x - roiRect.x - dx, m_predictionRect.y - roiRect.y - dy, m_predictionRect.width + 2 * dx, m_predictionRect.height + 2 * dy);
356358
}
357359
else
358360
{

0 commit comments

Comments
 (0)