Ask Your Question

Revision history [back]

Have a look at the cascade classifier to effectively "recognize" cars and motorbikes. This classifier is able to perform multi-scale recognition, so the difference in appearance shouldn't be a problem. OpenCV comes with an already trained car detector, but I don't know if it is suitable for your needs.

In a general approach, you don't necessarily perform object tracking before the recognition, but as you already have it and it could speed up a lot! your recognition stage (only try to recognize the detected object), you should try to keep it.

If you don't know how to start with the cascade classifier, have a look at these tutorials or the chapter 5 of the book named "OpenCV 3 Blueprints". They will give you a lot of indication on how to start, and (in the book) how important it is to collect a good dataset to fulfill your needs.