Questions tagged [cascade-classifier]

A particular case of Ensemble learning, which is based on the concatenation of several classifiers, using all information collected from the output from a given classifier as additional information for the next classifier in the cascade.

170 questions
1
vote
0 answers

Java OpenCV Error: Assertion failed

I need a little help with why am I getting this error: OpenCV Error: Assertion failed (clEnqueueReadBuffer(q, (cl_mem)u->handle, CL_TRUE, 0, u->size, alignedPtr.getAlignedPtr(), 0, 0, 0) == CL_SUCCESS) in cv::ocl::OpenCLAllocator::map, file…
Kladnik
  • 141
  • 8
1
vote
0 answers

opencv Unrecognized or unsupported array type in function cvGetMat (c++)

i'm trying to detect a face using a cascade classifier (haarcascade_frontalface_alt_tree.xml), but this line cascade.detectMultiScale(img, vec, 1.1, 2, CV_HAAR_FIND_BIGGEST_OBJECT, cv::Size(40, 40), cv::Size(125, 160)); gives me this error: OpenCV…
user2071581
  • 183
  • 2
  • 13
1
vote
1 answer

Bad trained cascade in OpenCV

I can't train the classifier properly.. When I use the generated cascade.xml the object is not recognized. Instead some parts of the object are. The command line for training is this: opencv_traincascade -data data -vec samples.vec -bg negatives.txt…
1
vote
1 answer

Face detection MATLAB - slanted and up side down

I am working on a MATLAB project which enables the user to do face detection and blur them out. Built-in functions used: vision.CascadeObjectDetector The problem with this function: It only detects frontal faces. The methods I tried: Use imrotate…
1
vote
1 answer

How to train tree of stages classifiers instead of cascade in OpenCV for face detection?

I found in haarcascade_frontalface_alt_tree xml as the xml file is trained with train tree of stages classifiers instead of cascade. I am wondering how to train for tree of stages classifier in OpenCV, which api to use and any example available for…
batuman
  • 7,066
  • 26
  • 107
  • 229
1
vote
1 answer

OpenCV: what is the difference between these 2 haar cascade data sets?

I have seen there are 2 different Haar Cascade datasets in OpenCV. For an example, take a look at haarcascade_upperbody.xml and haarcascade_mcs_upperbody.xml. what is this new mcs thing? The only difference I can monitor is that…
1
vote
0 answers

Opncv cascadetraining.exe's negative data

Could You please explain me, how opencv cascadetraining.exe uses negative images? If I have in negative.txt file only let say specified 30 images but I put negNum 3000, it will use only 30 out of them, or, It gets all possible permutations (random…
blakeO
  • 489
  • 1
  • 5
  • 6
1
vote
1 answer

Negative sample image dimensions for training cascaded classifier in OpenCV?

So following up from here, I now need to collect negative samples, for cascaded classification using OpenCV. With positive samples, I know that all samples should have the same aspect ratio. What about negative samples? Should they all be larger…
user961627
  • 12,379
  • 42
  • 136
  • 210
0
votes
0 answers
0
votes
0 answers

In general, how do people obtain negative samples for cascade classifier training?

If I want to implement a cascade classifier for detecting e.g. my jacket on an image, I can obtain the positive samples for it like this: take pictures of it from different angles and put each picture on a few backgrounds. If I want to detect any…
SNBS
  • 671
  • 2
  • 22
0
votes
0 answers

No output after running opencv cascade command

I am trying to make a cascade after a tutorial on youtube(at this point I am at minute 18:30z) and everything up until this point is working, but if I run the command: D:/OpenCV/build/x64/vc15/bin/opencv_traincascade.exe -data…
Q_Q_
  • 3
  • 2
0
votes
0 answers

Python OpenCV fails using haarscascade

Any suggestions how to fix this - its my first attempt as OpenCV. [ERROR:0@0.030] global persistence.cpp:505 open Can't open file: 'haarcascade_upperbody.xml' in read mode Traceback (most recent call last): File "/home/peter/src/personid/./2.py",…
0
votes
0 answers

OpenCV Python: cv2.cuda_CascadeClassifier().detectMultiScale() ends my program without error

Python: Anaconda3 Python 3.8.5 OpenCV: 4.5.1 I compiled OpenCV and OpenCV-Contrib with CMake so I could use the cuda functions in python. Now I am trying to detect faces with the cv2.cuda_CascadeClassifier().detectMultiScale() function. When I run…
0
votes
1 answer

cascadeClassifier.detectMultiScale get error: Insufficient memory in OutOfMemoryError

Hello everyone I have the following code: public boolean isContainsFace(String path){ Mat matImage = Imgcodecs.imread(path); MatOfRect faceDetections = new MatOfRect(); cascadeClassifier.detectMultiScale(matImage,…
Tamada
  • 3
  • 2
0
votes
0 answers

How do I load a saved model from drive with cv2? (CascadeClassifier)

I am trying to load my saved CNN model with cv2 the same way I managed to load this model. # initialize the Haar Cascade face detection model face_cascade = cv2.CascadeClassifier(cv2.samples.findFile(cv2.data.haarcascades +…