OpenCV object detect algorithm freezes after training cascade

廉价感情. 提交于 2019-12-12 01:08:55

问题


I trained the cascade classifier to detect letters, this is the code I'm using.

When I start the program, it opens my web cam but doesn't show the image (frames) and the detection but just a single blank window.

I noticed this line causes the problem:

faces_cascade.detectMultiScale(frame_gray, faces, 1.1, 2, 0 | CASCADE_SCALE_IMAGE, Size(30, 30));

This is the xml file.

What should I do to make it show the captured frames and start detecting?

Thank you.


回答1:


I finally got it, I had to train my cascade with the parameters of: -w 24 -h 24 to specify a rectangular image which I have used. Now the code runs normally.



来源:https://stackoverflow.com/questions/37943723/opencv-object-detect-algorithm-freezes-after-training-cascade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!