简体   繁体   中英

Haar Cascade: recognise a circle and ellipse

I'm need to recognise if in an image the are shapes that are similar at a circle or an ellipse with different orientation.

Some example:

I'm working with Haar cascade, I try different cascade but don't work very well.

I have bring a simple image of a black ellipse with a with background, with this I created my positive examples, maxzangle different to zero to have different orientation (right?)

opencv_createsamples -img ovale.png -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0 -maxyangle 0 -maxzangle 1.3 -num 500 -bgcolor 255

opencv_traincascade -data dati -vec positives.vec -bg bg.txt -numPos 450 -numNeg 300 -numStages 5 -w 21 -h 7 -maxFalseAlarmRate 0.2

It stop then the third stages, and if I try it didn't work.

Can you help me, please?

Haar Cascade Algorithm

  1. It is mainly for object detection of any shape.
  2. It plots a graph by marking the depressions in the object.
  3. More similar data need to be learnt to the algorithm is get most accurate value

For example:

  1. If algorithm needs to detect different weapons accurately.
  2. Human Face detection which includes detecting Eye,lip curve.

Condition :

Then algorithm need to be learnt with more number of weapon/human faces images,So that you get the most accurate value.

else

if the algorithm is learnt with few images of weapons/human faces,than algorithm may not be able to detect what the object Is, or it may show some value which of similar to some other object that has been learnt to algorithm.

I do not know about ellipse but OpenCV has Hough Circle Transform https://docs.opencv.org/3.4/da/d53/tutorial_py_houghcircles.html for detecting circles, which might be useful in this case. Keep in mind that if you want to use it, you need to find parameters values which fits your case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM