OpenCV to recognize image using python
Regarding your question about the haar cascades. You can use them to classify the images the way you want: 
Train two haar cascades, one for cars and one for bikes. Both cascades will return a value of how certain they are, that the image contains the object they were trained for. If both are uncertain, the image probably contains nothing. Otherwise you take the class with the higher certainty for the content of the image.
I am new to OpenCV.
I am using OpenCV 3.1 and python 2.7.
I have 5 images of bikes and 5 images of cars.
I want to find out given any image is it a car or a bike .
On the internet I found out that using haar cascade we can train,
but most of the examples contain only one trained data means, the user will train only car images and 
with query image and  they will try to find it it is a car or not,
but I want to check if it is a car or a bike or nothing.
I want to match images based on shape of objects.
Another option I was thinking that take query image and compare with stored images and depending upon similarity give the result. But I know this would take longer time which would be not good.
Are there any better option? There is also template matching but I dont know which would be better options to go for this kind of solution since I dont have knowledge about OpenCV.