matchTemplate仅适用于图像中的一个对象,并且对象必须具有与 template_image 相同的大小和旋转。 haarTraining生成 haarCascade.xml 文件需要很长时间。那么有没有其他没有这些问题的检测对象的方法呢?
2 回答
OpenCV 有一些非常好的对象检测样本(没有 haar 级联)。您应该查看matcher_simple.cpp作为起点。接下来要看的是descriptor_extractor_matcher.cpp和matching_to_many_images.cpp。matching_to_many_images.cpp
可能最接近您正在寻找的内容,因为它为您打破了训练和查询阶段,并允许持久存储训练描述符。
另外,请查看 features2d教程。
希望有帮助!
There are many ways to detect objects, and there are many problems with each of them. It depends on the specific problem you are facing.
Haar object detection is a good one. The training phase is only needed once, then you can reuse the haarcascade.xml each time you run the program, and of course you can distribute it to others as well.
Other detectors include HOG, LBP, SIFT. Note that all of them take some time for training.