haar-classifier

OpenCV Facial Detection come ups with this error

匆匆过客 提交于 2021-02-11 16:56:57
问题 I keep getting this error: faces = face_cascade.detectMultiScale(gray, 1.3, 5) cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-wvn_it83\opencv\modules\objdetect\src\cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale' when trying to run this code import cv2 import numpy as np face_cascade = cv2.CascadeClassifier('haarcascase_frontalface_default.xml') cap = cv2.VideoCapture(0) while 1: ret, img = cap

OpenCV Facial Detection come ups with this error

£可爱£侵袭症+ 提交于 2021-02-11 16:55:38
问题 I keep getting this error: faces = face_cascade.detectMultiScale(gray, 1.3, 5) cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-wvn_it83\opencv\modules\objdetect\src\cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale' when trying to run this code import cv2 import numpy as np face_cascade = cv2.CascadeClassifier('haarcascase_frontalface_default.xml') cap = cv2.VideoCapture(0) while 1: ret, img = cap

opencv_createsamples: command not found ubuntu

爷,独闯天下 提交于 2021-01-28 14:24:07
问题 I am following Creating your own Haar Cascade OpenCV Python Tutorial But when I get to making the samples I get opencv_createsamples: command not found I am using this to create the samples opencv_createsample -img img.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 573 but I know the command exists because when I do man opencv_createsamples it pulls up the man page. I am using ubuntu 20.04.1 回答1: I have also met this same problem while

haar cascade positive example image sizing

本小妞迷上赌 提交于 2020-08-04 05:30:50
问题 Im taking my first steps in making a haar cascade for custom object recognition. Ive spent time getting a fair bit of data and wrote some preprocessing scripts to convert videos to frames. My next step is to crop the object of interes in order to create some positive training examples. I have a few questions which i genuinely have looked around for answers online - i'm slightly confused:- I read i should aim to keep the aspect ratio the same - does this mean the same as the original frame OR

haar cascade positive example image sizing

有些话、适合烂在心里 提交于 2020-08-04 05:30:17
问题 Im taking my first steps in making a haar cascade for custom object recognition. Ive spent time getting a fair bit of data and wrote some preprocessing scripts to convert videos to frames. My next step is to crop the object of interes in order to create some positive training examples. I have a few questions which i genuinely have looked around for answers online - i'm slightly confused:- I read i should aim to keep the aspect ratio the same - does this mean the same as the original frame OR

Error using the 'find' command to generate a collection file on opencv

一个人想着一个人 提交于 2020-06-28 14:36:07
问题 I am facing a problem generating a collection file of the positive images to train the Haar Cascade in OpenCV to detect a car. On every tutorial I found on the internet, it is the same command, however i am unable to execute it. I am using Command Prompt and Windows Power Shell to execute this command. find ./positive_images/ -iname '.*pgm' > positives.txt the screenshot of the output I am running this command from root of my directory. The positive images are stored in positive_images folder

Hand detection and tracking methods

余生长醉 提交于 2020-06-25 18:15:51
问题 So, guys, please help me with detecting/tracking hand for user who are sitting at the computer in front of computer(laptop) frontal camera. I've tried these methods: Colour based detection (I've detected the human face by opencv haar cascade face detection and extracted the skin HSV ranges. In the next I've found the objects with the skin colour. For example, the face I can remove by knowing face detection by haar cascade, but what about other human body parts and background objects with skin

Can numPos be a Negative Number in Haar Cascade Training

这一生的挚爱 提交于 2020-02-08 06:41:46
问题 I am trying my own haar cascade classifier I have 2139 positive images However I have 16000 negative images This is right ? And so I have a negative numPos Because: numPos<=(Positive samples-negative samples)/(1+(stages number-1) (1-minhitrate))) so: (2139-16000)/(1+(17-1) (1-0.995))=-12834 This is normal?? 回答1: no, numPos has nothing to do with your negative samples. numPos is the number of positives you want to use in each stage. This must be a bit lower than your total number of positive

An advice about parameters in opencv_traincascade

五迷三道 提交于 2020-01-01 19:18:09
问题 I am doing a project that consists in recognize a banana using haar features. I am using EMgucv and visual studio 2010 for that. I am using opencv_createsamples and opencv_traincascade.I have a question about parmeters. What happen if I increase those values? I set: -numPos 3800 -nunNeg 6000 -numStages 16 -minHitRate 0.999 -maxfalseAlarmRate 0.3 but I want to know What are maxWeakCount and maxdetph parameters? What means? I want and example to understand that 来源: https://stackoverflow.com

opencv_createsamples: Invalid background description file?

喜欢而已 提交于 2019-12-24 07:51:04
问题 I'm trying to run create samples on Ubuntu 16.04 with OpenCV, and I keep coming across this error when it runs. I have about 1960 negative images that I'm trying to generate sample images from. What i'm running in the terminal is: opencv_createsamples -img pipe1.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 5 -maxyangle 5 -maxzangle 5 -num 1950 and and abbreviated output is: Open background image: neg/930.jpg Open background image: neg/11.jpg Open background image: neg/332.jpg