Raspberry Pi Lesson: OpenCV Car Counter

Raspberry Pi OpenCV Car Counter adalah bagi mengira bilangan kereta atau objek yang bergerak. Oleh kerana tiada live video, jadi hanya menggunakan video contoh kereta yang bergerak. OpenCV akan melakukan proses video dan mengedit video tersebut. Titik merah akan menandakan kedudukan kereta, garisan hijau menandakan lintasan yang akan diambil kira dan tulisan biru memaparkan bilangan semasa. Namun cara ini masih ada kelemahan bagi mengenalpasti kereta.

Proses video ini hanya menggunakan OpenCV. Melalui Terminal Raspberry Pi, gunakan command berikut.

$ sudo apt-get install python-opencv
$ sudo pip install imutils

Download video contoh disini.

Berikut adalah demo Raspberry Pi OpenCV Car Counter.

Video dari file

Video dari camera

Python Source Code

5 Replies to “Raspberry Pi Lesson: OpenCV Car Counter”

  1. So can you explain ”sec” mean in this code? I tried to find information about this line of code but it is no clue in opencv. That would be nice if u can tell some info about it. Thank u

  2. Can explain more clearly about this part of code for me:
    if sen==1:
    Here, what role that " sen " play in the counting part ?. And i also wonder how the counter didnt plus + 1 when the centroid have x greater than linecount after counted ?. Thank you very much.

Leave a Reply to Phan Nhật Huy Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.