Giter Site home page Giter Site logo

Comments (8)

skvark avatar skvark commented on July 18, 2024 3

Thanks for the report, I'll add them to the package in next release. I have to go first through the licenses of those files. Most of them seem to be under BSD-like license so shouldn't be a problem to include them.

from opencv-python.

skvark avatar skvark commented on July 18, 2024 3

I had a better look into this. That tutorial is a bit misleading since it's not very clear on where the script has to executed:

"Those XML files are stored in the opencv/data/haarcascades/ folder."

Now, even if I distribute all the XML files with this package the following line won't still work because it tries to read the XML file from the same folder where your script is executed:

face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')

If I add those files in the package, you will have to use something like this:

haarcascades_path = os.path.dirname(cv2.__file__) + "/haarcascade_frontalface_default.xml"
face_cascade = cv2.CascadeClassifier(haarcascades_path)

from opencv-python.

skvark avatar skvark commented on July 18, 2024 1

The haarcascades path can be accessed now via cv2.data.haarcascades.

from opencv-python.

a-aitken avatar a-aitken commented on July 18, 2024

Great, thanks!

from opencv-python.

abitrolly avatar abitrolly commented on July 18, 2024

Maybe add from cv2 import DATA as a helper for os.path.dirname(cv2.__file__)?

Or maybe even a constant cv2.data.haarcascade if there are not many files.

from opencv-python.

skvark avatar skvark commented on July 18, 2024

Yes, I was thinking about something like cv2.data.haarcascades which is the path to the folder which contains the haarcascade files.

from opencv-python.

tsbawa61 avatar tsbawa61 commented on July 18, 2024

Can anybody tell how to set path for xml files

from opencv-python.

Harish1901 avatar Harish1901 commented on July 18, 2024

Hi all..I am using openCV2 with OS X Xcode....why there is no data folder in opencv framework ? to use haar cascade xml file..kindly help me out

from opencv-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.