haar-classifier

Haar Training: error (-215)_img.row * _img.cols == vecSize in function

孤人 提交于 2019-12-23 09:27:55
问题 I am trying to train a Haar Cascade to detect hands. I have a vec file of size 1000. I have 40 positive images and 600 negative images. I have tried both dropping my positive images and negative images. When I run the following command I receive the following error: opencv_traincascade -data classifier -data classifier -vec samples.vec -bg negatives.txt -numstages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000\ -numNeg 600 -w 80 -h 40 -mode ALL -precalcValBufSize 1024\

OpenCV for Android: failed to load cascade classifier error

假装没事ソ 提交于 2019-12-19 02:46:18
问题 This is the first time I use openCV library. I want to use it to detect the eyes. I have used the FdActivity code available in this tutorial: http://romanhosek.cz/android-eye-detection-updated-for-opencv-2-4-6/ The tutorial uses OpenCV 2.4.6, but I have downloaded version 3.1 in my project. Due to the version differences I have changed the lines that uses putText, rectangle, and circle to be imported from imgproc instead of Core. This is all what I've changed. I have added haarcascade_lefteye

OpenCV: detectMultiScale() gives too many points out of the object

岁酱吖の 提交于 2019-12-14 01:44:22
问题 I trained my pc with opencv_traincascade all one day long to detect 2€ coins using more than 6000 positive images similar to the following: Now, I have just tried to run a simple OpenCV program to see the results and to check the file cascade.xml . The final result is very disappointing: There are many points on the coin but there are also many other points on the background. Could it be a problem with my positive images used for training? Or maybe, am I using the detectMultiScale() with

HAAR classifier-how to detect only ONE face at a time

三世轮回 提交于 2019-12-12 03:16:47
问题 Using a C# implementation of Open CV which in turn is directly based on the OpenCV Java source here. http://docs.opencv.org/java/ The specific line where I call the HAAR classifier is cascade.detectMultiScale(grayMat, faces, 1.2, 3, 2, new Size(60, 60), new Size(150, 150)); The problem is I only want to track one face at a time, even if several are detected. ie if there are 2 faces detected, my tracking rectangles keep jumping randomly between the 2 faces. How can I ONLY detect 1 face at a

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

Creating Haar Cascade from images shows error

狂风中的少年 提交于 2019-12-11 16:36:00
问题 I want to create my own haarcascade for license plates. I have found a GUI called Cascade-Trainer-GUI that does this. I'm using Windows 10. You can download gui from here: http://amin-ahmadi.com/cascade-trainer-gui/ I have two folders with positive and negative images. There are about 650 positive images and 570 negative images. When I run the program, it finishes in a couple of seconds, but I do not get cascade.xml file. I get .txt file, and in the end of that txt file it says : OpenCV Error

people detection with haar cascade

好久不见. 提交于 2019-12-11 12:26:07
问题 I am working on a project in my school to detect how many students are in the classroom. Like in this picture. I have been trying to use Haar Cascade in opencv for face detection to detect people, but the result is very bad. Like this: I took thousands of pictures in classroom, and cropped the picture with people manually. There are about 4000 positive samples and 12000 negative samples. I was wondering what did I do wrong? When I crop the image, should I only crop only head like this? Or

Ideas to improve Haar training results

杀马特。学长 韩版系。学妹 提交于 2019-12-11 09:24:56
问题 Please help to get more knowledge on the my first-time haar training results. So I want to train Haar classifier to recognize simple pen, following Dileep Kumar’s article. Using my cellphone I made 14 pen pictures. These pictures size is big about: 263x2814 Then I collected negative pictures, some of them downloaded from web, with size 640x480 , and some of them made using my phone camera, with size: 1920x1080,5313x2388 Some of these negative images are really big. I have total 158 negative

Where to get negative sample images for Haar training? [closed]

三世轮回 提交于 2019-12-11 04:09:42
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I need a collection of sample images to train a Haar-based classifier for face detection. I read that a ratio of 2 negative examples for each positive example is acceptable. I searched around the web and found many databases containing positive examples to train my classifier (that is, images that contain faces)

how to limit number of faces detected by haar cascades

放肆的年华 提交于 2019-12-11 02:48:02
问题 I am using Haar cascade in an emotion detection system. Every video input I am giving to the model has only one face in it (It is a requirement). When I run Haar cascade model to detect faces, it has some false positives. Since I have only one face in the video, I want to take the most positive area detected and ignore all other detection. Is there a way to do that? 回答1: when you are calling detectMultiScale function, set the minNeighbours value to a high value to avoid false positives. Also,