How to create Haar Cascade (.xml file) to use in OpenCV?

前端 未结 4 2149
不知归路
不知归路 2020-11-30 18:51

If you are familiar with OpenCV library, you know what Haar Cascade image object detection is. By image object detection I mean, like human face detection or something else.

4条回答
  •  借酒劲吻你
    2020-11-30 19:30

    How to create CascadeClassifier :

    1. Open this link : https://github.com/opencv/opencv/tree/master/data/haarcascades
    2. Right click on where you find "haarcascade_frontalface_default.xml"
    3. Click on "Save link as"
    4. Save it into the same folder in which your file is.
    5. Include this line in your file face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")

提交回复
热议问题