Pergunta

I am trying to create a face detection program using python 2.7.3 and opencv 2.4.3. I have been looking at a lot of code online, and I always see two lines of code that create storage after creating an image, and then the storage is cleared. Why it is necessary to create storage and then clear it?

Here is an example:

storage = cvCreateMemStorage(0)
cvClearMemStorage(storage)

Here is one of the links I am referencing: https://geekwentfreak-raviteja.rhcloud.com/2011/02/faceeyehand-detection-using-opencv-python-binding/

Thanks for any help!

Foi útil?

Solução

the code you're refering to is using the outdated c api, and the old cv wrapper. please don't use that !

prefer the newer cv2 api (together with numpy), the old one will go away in near future.

https://github.com/Itseez/opencv/blob/2.4/samples/python2/facedetect.py

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top