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

前端 未结 4 2126
不知归路
不知归路 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:13

    This might be helpful

    http://opencvuser.blogspot.in/2011/08/creating-haar-cascade-classifier-aka.html

    0 讨论(0)
  • I think this might be helpful:

    http://note.sonots.com/SciSoftware/haartraining.html

    0 讨论(0)
  • 2020-11-30 19:23

    If you are interested to detect simple IR light blob through haar cascade, it will be very odd to do. Because simple IR blob does not have enough features to be trained through opencv like other objects (face, eyes,nose etc). Because IR is just a simple light having only one feature of brightness in my point of view. But if you want to learn how to train a classifier following link will help you alot.

    http://note.sonots.com/SciSoftware/haartraining.html

    And if you just want to detect IR blob, then you have two more possibilities, one is you go for DIP algorithms to detect bright region and the other one which I recommend you is you can use an IR cam which just pass the IR blob and you can detect easily the IR blob by using opencv blob functiuons. If you think an IR cam is expansive, you can make simple webcam to an IR cam by removing IR blocker (if any) and add visible light blocker i.e negative film, floppy material or any other. You can check the following link to convert simple webcam to IR cam.

    http://www.metacafe.com/watch/385098/transform_your_webcam_into_an_infrared_cam/

    0 讨论(0)
  • 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")
    0 讨论(0)
提交回复
热议问题