How to train a CascadeClassifier to detect object with different aspect ratio?
I tried to detect object which could have different aspect ration in the positive photo.
I used the next params: opencv_traincascade -data haarcascade -vec samples.vec -bg negative.dat -numStages 15 -minhitrate 0.99 -maxFalseAlarmRate 0.4 -numPos 797 -numNeg 933 -w 15 -h 30 -mode ALL -precalcValBufSize 2048 -precalcIdxBufSize 2048
So, aspect ratio is 1:2 in the image pattern.
And when I use a generated cascade.xml I can detect an object in the pictures only with the similar aspect ratio. But some photos contains objects with 2:3 or even 1:1 ratio.
How can I detect these objects?
Edit: CascadeClassifier is not a neural network, it is a cascade of classifiers (obviously)
You can't. Best approach, take images as training of different ratios and transform them to an average ratio. That has worked for me for slight deviations in ratio. If the ratio changes drastically, you need seperate detectors build for different ratios!