Differentiate cars and motorcycles in image processing

I'm currently doing a project of transportation counting but is it possible to count cars and motorcycles separately? Is it possible to count the cars and motorcycles separately by their area of the vehicle? If it is possible, how do I draw a boundary around them and compare both areas of the vehicles? Thanks in advance.

Answers (2)

Depending on your surrounding it might be possible.
You could use a cascade object detector and train it to recognize motorcycles from a specific angle. therefor you would need thousands of motorcycle pictures from that specific angle. The same goes for cars, train another detector for cars in the same specific angle.
If you now take a video in said angle you can use those detectors to find and track the cars/motorcycles. Thats just a general idea, i also might not work, but with enough time and training those detectors are really useful for such things.

5 Comments

I have been doing some poking around, and so far the only essential difference I can find stated between cards and motorcycles is that cars have separate transmission fluid but motorcycles use engine oil to lubricate the transmission. This is a detail that you would have a great deal of difficulty figuring out from images unless the images happened to be close views of the respective engines.
See the illustrations I posted in my link. Or google for "three wheeled motorcycle" and notice how much some of them look like images you can find for "three wheeled car".
My understanding of the question was that OP wants to set a camera on a street and count vehicles passing (or analyse a video), but want to differentiate between cars and motorcycles. I dont exacly know what the engine has to do with that...
but he wants to seperately count cars and motorcycles. A trained object detector could do that (probably not with 100% detection rate), but the training has to be done with thousands of images from the angle on which he intends to monitor the street.
And of course, if something like a three wheeled motorcycle comes by its hard to differentiate, but if one manages to train the detectors good enough the majority of vehicles will be detected. All left objects could be stored for review later, if you find a object but neither of the detectors can classify it, then store it and take a look later personally.
A CNN might be also suitable for the task, but again, a lot of training data is needed to make it effective.
So, a trained object detector could work on this. Thank you so much! But at the mean time, I guess I'll keep it a little bit simple by only using cars. This will simplify the work by a lot right?
Depending on your setup. If you plan to carry around a camera and film different spots then most likly no. If you have a static camera it might work (take a look at the link with gaussian mixture models i posted).
The object detector will need a lot of training data (for so many cars id say 5k-10k positiv images and 20-40k negative maybe?). And then you would have to train another for motorbikes ( no, you cant use one detector for both ^^ )
The other option would be a CNN.
You can use nearly exactly the same shell but different engines and one would be a car and the other would be a motorcycle. Maybe the grill would have to be slightly different for cooling purposes, I don't know. So you cannot differentiate between the two based on area or color or profile.
Because aerodynamics do not change, until you get to rocket powered vehicles, the profiles of light racing vehicles converge regardless of whether the vehicle is car or motorcycle or direct human power (bicycle / tricycle) or human power with capacity for storing energy (even if just flywheel). The competition human powered vehicle I posted the image of before looks a lot like some car images I found such as for cars competing for low energy consumption. But the car version has to be counted and the bicycle must not be.
In the area that I live in, the electric bicycle that I posted the image of is classified as a motorcycle for licence purposes, which is unfortunate because the insurance rates for motorcycles are much higher than for cars (the accident rate is lower, but accidents between cars and motorcycle or bicycle are much less serious for the car driver). So all of the apparent bicycles have to be closely examined to see if they have a motor assist anywhere, including carefully recognizing models because two or more manufacturers specialize in hidden motor assist. Scooters that have motor assist are likewise legally motorcycle class here. But in some jurisdictions, motor assist does not change the class of vehicle until 1/2 horsepower or 3/4 horsepower

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Products

Release

R2017a

Asked:

on 29 Jun 2018

Commented:

on 29 Jun 2018

Community Treasure Hunt

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

Start Hunting!