MATLAB Answers

Specifying object properties to be detected

1 view (last 30 days)
Hello everyone. I am currently working on a project to count the number of vehicles on a road from video using video processing by blob detection. The code I have can only detect cars. But I need to detect other types of vehicle as well. I want to how to specify a particular object's properties such as a van or truck to be detected in matlab. Please guide me. Thanks in advance. Regards

  13 Comments

Walter Roberson
Walter Roberson on 13 Sep 2018
You need to go back to the first link I posted for you that demonstrates that you cannot differentiate between bicycle and motorcycle and car through image alone.
While I was researching I encountered a story about a fellow who built custom four wheel bicycles to drive around his handicapped relative. Municipal police gave him a ticket for operating an illegal vehicle because local law defined bicycle as having at most three wheels. The same laws defined motorcycle and car as being motor vehicle but he had no motor so he could not qualify for those. He was in a legal position of being unable to license the bicycle in any category, and thus was legally restricted to using the bicycles only on private property.
What he did was convince the local government to change their definition of bicycle, with considerable support from his neighbours who were proud of the way he was helping his handicapped relative.
Before his campaign, his device was legally nothing. Afterwards it was legally a bicycle. The exact same device and the exact same jurisdiction.
And therefore you cannot determine categories by image alone. Categories are legal more than they are technical.
Shahrin Islam
Shahrin Islam on 13 Sep 2018
See i understand what you are saying. I am using it for simple research purpose and only for the road of my country where tge vehicle types are clearly defined. The practical implication is not a case here. I hope you understand.
Walter Roberson
Walter Roberson on 13 Sep 2018
I am not aware of any country where the vehicle types are clearly defined. Especially not countries where rickshaws are common enough to be worth mentioning: in those countries there is typically a lot of personal innovation that blurs the lines badly.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 12 Sep 2018
You can use other code or relax the discrimination criteria. The usual way is to
  1. detect everything that moves (that's what it sounds like you want), and then to
  2. examine each moving blob to determine which are cars and which are not, then
  3. just keep the cars and throw out everything else.
It sounds like your code does all three steps because you said "The code I have can only detect cars." You need to modify it so that it does not do steps 2 and 3.

  6 Comments

Show 3 older comments
Shahrin Islam
Shahrin Islam on 12 Sep 2018
I would be grateful if you could please give me some links where I can learn deep learning to solve my problem.
Image Analyst
Image Analyst on 12 Sep 2018
It's all over the Mathworks's home page right now: https://www.mathworks.com/ You can't miss it.
Shahrin Islam
Shahrin Islam on 12 Sep 2018
thank you so much.. it's so kind of you.

Sign in to comment.

More Answers (1)

Shahrin Islam
Shahrin Islam on 16 Sep 2018
image analyst i wanted to show you the video i am working on. But this site doesn't suport uploading a mp4 file. Can you have any other access? Thanks in advance.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by