cascade-classifier

OpenCV Haar Cascade Creation

Deadly 提交于 2021-01-07 04:30:11
问题 I want to try create my own .xml file for my graduation project with this reference. But I have a problem which stage 6 doesn't work.It gives error such as: Traceback (most recent call last): File "./tools/mergevec.py", line 170, in <module> merge_vec_files(vec_directory, output_filename) File "./tools/mergevec.py", line 120, in merge_vec_files val = struct.unpack('<iihh', content[:12]) TypeError: a bytes-like object is required, not 'str' I have found a solution which says find 0 size vector

OpenCV Haar Cascade Creation

≯℡__Kan透↙ 提交于 2021-01-07 04:29:28
问题 I want to try create my own .xml file for my graduation project with this reference. But I have a problem which stage 6 doesn't work.It gives error such as: Traceback (most recent call last): File "./tools/mergevec.py", line 170, in <module> merge_vec_files(vec_directory, output_filename) File "./tools/mergevec.py", line 120, in merge_vec_files val = struct.unpack('<iihh', content[:12]) TypeError: a bytes-like object is required, not 'str' I have found a solution which says find 0 size vector

OpenCV: Improving the speed of Cascades detection

依然范特西╮ 提交于 2020-01-12 04:06:29
问题 I need to detect people in real time using OpenCV Cascades. Currently I am using the trained cascade files which comes with OpenCV but later I will train my own LBP Cascades to achieve more speed. I do have a question. what are the ways to speed up the detection of cascades? For an example, have a look at this video. It is really fast, uses Haar cascades and nice. what kind of things I can do to achieve this speed, specially for a real time application? any tricks and hacks? 回答1: I'm not sure

What are the recommended parameters for opencv_traincascade?

筅森魡賤 提交于 2019-12-25 06:32:54
问题 I am using OpenCv 2.4.10 . I have recently tried to create my own cascade classifier to detect robotino; I have 240 negative samples and 650 positive samples. But I am getting confused in the values I should give to the opencv_traincascade . numNeg : states the number of negative samples used in each stage. How should I calculate this parameter? numStage : How should I tell the number of stages wanted ? 回答1: A few points to consider: numNeg can be all the negative samples you have, however

How can I resize an image where the face should be cropped and scaled to fit the size?

对着背影说爱祢 提交于 2019-12-25 03:04:07
问题 My webcam takes images. But opencv gender classification needs the images to be of the same size of that of the images used to train. So I need my webcam images to be 300x300 where the face in the webcam images would fit the resolution 300x300. I have identified the face in the webcam image using opencv face cascade classifiers. But how can I crop that face to fit in the size of 300x300? Please help with some code lines as I am new to opencv. 回答1: Here a small sample that will help you to

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

cascade classifier detectMultiScale with reject levels

為{幸葍}努か 提交于 2019-12-23 04:14:36
问题 I'm working on objects detection with cascade classifier on OpenCV 3.1 and VC++ 2015. I want to force the cascade to detect only one object for each image and I want to get its accuracy score. For that, I tried to use the undocumented prototype of the method CascadeClassifier::detectMultiScale with reject levels. The documented version works good. But the version with reject levels still executing for a long time without giving any result. this is my source code below. #include "stdafx.h"

cascade classifier detectMultiScale with reject levels

故事扮演 提交于 2019-12-23 04:14:29
问题 I'm working on objects detection with cascade classifier on OpenCV 3.1 and VC++ 2015. I want to force the cascade to detect only one object for each image and I want to get its accuracy score. For that, I tried to use the undocumented prototype of the method CascadeClassifier::detectMultiScale with reject levels. The documented version works good. But the version with reject levels still executing for a long time without giving any result. this is my source code below. #include "stdafx.h"

Recommended values for OpenCV detectMultiScale() parameters

旧巷老猫 提交于 2019-12-17 10:10:01
问题 What are the recommended parameters for CascadeClassifier::detectMultiScale() and depending on which factors I should change default parameters? void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size() ) 回答1: Amongst these parameters, you need to pay more attention to four of them: scaleFactor – Parameter specifying how much the image size is reduced at each image scale.

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