ahmetozlu / vehicle_counting_hog_svm

Vehicle detection, tracking and counting by SVM is trained with HOG features using OpenCV on c++.
https://www.youtube.com/watch?v=itmV7druy9Y&feature=youtu.be
MIT License
97 stars 36 forks source link

How do you determine the formula to count the detected vehicle? #4

Open yovir opened 6 years ago

yovir commented 6 years ago

For example if I want to count a three lane instead of two lane, how do I determine the formula for the center lane? Example of right lane and left lane based on your code:

if ((abs(center.y - img.rows * 2 / 3) < 3) && img.cols / 1.55 <= center.x && center.x <= img.cols)

if ((abs(center.y - img.rows * 2 / 3) < 4) && 0 <= center.x && center.x <= img.cols / 3)