Raspberry Pi Lesson: OpenCV Car Counter

September 27th, 2018  Posted at   Lesson Raspberry Pi
arrow   |   5 Commentsarrow

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.

Download video contoh disini.

Berikut adalah demo Raspberry Pi OpenCV Car Counter.

Video dari file

Video dari camera

Python Source Code

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

  1. Muhammad Syafiq says:

    Assalamualaikum boleh bro tolong sye..project sye same mcm ni?

  2. Phan Nhật Huy says:

    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

  3. Phan Nhật Huy says:

    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

What is 3 + 6 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)