Ask Your Question

DerrickB's profile - activity

2021-11-20 23:07:27 -0600 received badge  Popular Question (source)
2019-12-21 18:50:44 -0600 received badge  Popular Question (source)
2016-12-18 03:51:53 -0600 commented answer opencv_traincascade Negative samples training method

but when i have 1000 images and a maxFalseAlarmRate= 0.5 after 10 stages there is just 0.97neg images left? how does this work???

2016-12-18 02:57:36 -0600 commented question Cascade Classifier Training: Is the negNum decreasing each stage?
2016-12-17 19:00:47 -0600 asked a question Cascade Classifier Training: Is the negNum decreasing each stage?

Hello guy,

Does the second stage train with the exact same training samples as the first stage or just with 0.5x of the negative samples (maxFalseAlarmRate = 0.5). The 0.5 neg sampels which were classified false?

If yes: Why does the second stage needs more features to separate the data?

If no: Is the amount of negative samples decreasing each stage by 0.5? After 20 stages there would be nearly no samples?

I hope the question is understandable,

Thanks a lot for your help!!!

Kind regards,

Derrick

2016-12-16 06:38:37 -0600 asked a question Cascade Classifier Preprocessing Question

Hello Open CV Community,

When the current sliding window (e.g. 50x50) has twice the size of the training data samples (e.g. 25x25), how does the Cascade Classifier predict it???

I thought of two possible solutions, but i dont know which on is correct:

A: The image from the sliding window is resized to the format of the training data samples.

or

B: It doesn't matter because the feature calculation is format independent?

This question is for the purpose of understanding the Cascade Classifier process. I hope somebody can help.

Thank you very much,

Derrick

2016-12-16 06:28:38 -0600 commented answer Is it possible to run the CascadeClassifer without preprocessing?

Yes with this solution it works, thanks!

2016-12-12 04:25:25 -0600 commented answer Is it possible to run the CascadeClassifer without preprocessing?

i cant find the methods "setImage" or "runAt". I think they are private or something???

2016-12-02 04:27:44 -0600 asked a question RejectLevels and LevelWeights of detectMultiscale

Hello everybody,

can somebody explain the the meaning behind the two values "RejectLevels" and "LevelWeights"?

My research made me come to the conclusion that "RejectLevels" should return the stage in which the object was sorted out and "LevelWeights" should return an value comparable to a confidence.

My experience is:

If a object is found LevelWeights returns the amount of stages i trained the classifier with (this is logical, because the object has passed all stages) but if no object is found LevelWeights remains empty. So i cant get any information out of this value??

The value RejectLevels returns for every found object a value like 2.3345455. But i cant see any meaning or structure behind it, it seems random for me.

Can somebody explain this to me?

Thank you very much,

Kind regards,

Derrick

2016-11-30 05:36:30 -0600 asked a question Is it possible to run the CascadeClassifer without preprocessing?

Hello OpenCV Community,

is it possible to run the CascadeClassifier without the Preprocessing (Sliding Window and Image Pyramid). I mean i want to give really small image fragments as input (e.g. 24x24) and the Classifier should just say positive or negative.

If i put the ScaleFactor and minSize of the multidetect method to "1" and minSize to "24x24" the method crashes.

This is for research and performance test.

Thank you very much,

Kind regards,

Derrick

2016-11-29 05:17:38 -0600 commented answer Number of stages or maxFalseAlarmRate?

@StevenPuttemans Does it mean that if i decrease the maxFalseAlarmRate (i.e. 0.4) the speed of my classifier is becoming worse but the it has less False Positives?

Does it mean that i should not increase the maxFalseAlarmRate above 0.5 because my weak classifers are not better than random guessing?

2016-11-26 08:47:34 -0600 commented question Preprocessing from Cascade Classifier for Decision Trees

@berak Can you tell me how i use features (LBP/ HAAR) with the DTrees?

Does it make any sense to use DTrees for Object Detection (without recognition)?

2016-11-24 07:45:10 -0600 commented answer Explanation of cascade.xml in a haar classifier

@StevenPuttemans thank you!

2016-11-24 07:27:47 -0600 commented answer Explanation of cascade.xml in a haar classifier

@StevenPuttemans Is it right to think of it like this: in Stage "n" the Classifier checks the image with Feature 1 and if the Value is bigger/ smaller as the Feature Threshold the first/ second LeafValue is added to the stagevalue. After all Features of the stage the StageValue is compared with the stagethreshold and decided if the stage is passed or not????

2016-11-23 06:33:52 -0600 commented question Preprocessing from Cascade Classifier for Decision Trees

I used LBP and Haar Features for the Cascade Classifier. ( I prefer LBP because of the training time)

For DTree i dont know how to use/ select feature. I train it with 24x48 px positive and negative Images.

My Problem is: I cant put whole Input Pictures in the DTree Prediciton, i need to cut it by myself in the trained Image size (24x48). In "detectmultiscale" of CC i can put the whole image in. (e.g. 270x480)

@berak

2016-11-22 14:39:44 -0600 received badge  Editor (source)
2016-11-22 14:37:42 -0600 asked a question Preprocessing from Cascade Classifier for Decision Trees

Hello OpenCV Community,

i want to compare/ test the performance of Decision Trees and Cascade Classifiers for Person Detection. My Problem is that the cv::CascadeClassifier does the Preprocessing like Sliding Window etc. automatically in its Methods but the cv::DTree dont.

Is there a solution to extract the methods from the CC and use it for the DTrees also, or does the cv::DTree has something comparable?

I hope the question is understandable.

Thank you for your Advice,

Kind regards,

Derrick

2016-11-14 14:19:58 -0600 commented question std::length_error at Ptr<cv::ml::DTrees> train

@berak i created a new question for my problem, i hope you can help. Thank you.

2016-11-14 14:19:04 -0600 asked a question std::length_error at Ptr<cv::ml::DTrees> train

Hello Open CV Community,

i try to train my Decision Tree but always get the same Error:

Unhandled exception at 0x00007FFC34287788 in DecisionTrees.exe: Microsoft C++ exception: std::length_error at memory location 0x0000004ECC0FF560.

The Error comes with the 3. Line. No Matter whats in the "Feature" or "Labels" Matrix. (I tried it even with just 0 and 1)

Ptr<cv::ml::DTrees> model = cv::ml::DTrees::create();

Ptr<cv::ml::TrainData> myTrainData = cv::ml::TrainData::create(Features, cv::ml::ROW_SAMPLE, Labels);

model->train(myTrainData);

Do somebody know how to handle this error?

Thanks a lot for your support!

Kind regards, Derrick

2016-11-14 08:18:47 -0600 commented answer How to train Decision Trees? How to fill TrainData with Images?

@berak I always get an Error when i want to train the Decision Tree (model->train(...))

it says:

... std::length_error at memory location ...

i cant find a solution in the Internet. Do you know where the Problem is. (Should i make a new topic for this question?)

2016-11-09 07:58:14 -0600 commented answer How to train Decision Trees? How to fill TrainData with Images?

@berak Thank you very much. This helps a lot my understandings. I will try this an give later notice if made it.

I got a question about your last sentence ("that using e.g. HOG or LBPH features instead of images should be considered"):

Do you mean using SVM and HOG features? Or do you mean i should train my DTree with HOG Features?

I know that SVM and CascadeClassifier are the better options but i want to try + understand Dtrees.

2016-11-09 06:39:25 -0600 received badge  Enthusiast
2016-11-08 17:10:58 -0600 commented question How to train Decision Trees? How to fill TrainData with Images?

@LBerger First Thank you for your patience with me!

This is the traincascade tutorial, i trained a CascadeClassifier with that. But i dont get how to use it for Decision Trees. Can I use it for Decision Trees or is there something comparable for Decision Trees?

2016-11-08 12:56:56 -0600 commented question How to train Decision Trees? How to fill TrainData with Images?

@LBerger I don't get that either. I'm Sorry. 400 lines uncommented Code is like a foreign language for me.

i just wanna put positive Images (e.g. face) and negative Images (e.g. no faces) into the cv::ml::TrainData and train des Decision Tree. (like a CascadeClassifier) Please correct me if i am complete wrong and DTrees cant be trained like that.

2016-11-08 11:49:40 -0600 commented question How to train Decision Trees? How to fill TrainData with Images?

@LBerger thanks for your answer. I actually had red this Code, but i don't really get it completely. So i cant transfer it to my problem.

The Code transfers a vector<points> to a Mat and then into TrainData. Where should i put positive and negative Trainingsimages.

Sorry, i am pretty new...

2016-11-08 09:39:17 -0600 asked a question How to train Decision Trees? How to fill TrainData with Images?

Hello OpenCV Community,

after you helped me a lot with my Cascade Classifier problems, i have a new question about decision trees (C++).

I want to train Decision Trees to recognize Persons. I red the official Implementation and all forum themes i could find about this topic, but i still dont know how to train my decision tree.

The function cv::ml::train() wants cv::ml::TrainData() as argument. How do i become my positiv and negativ images in the array of cv::ml::TrainData()???

Does somebody has an example Code of the Training of his Decision/ Random or Boosting Tree? (Doesnt matter if its Face Recognition or something like that)

Thank you a lot, Kind regards, Derrick

2016-11-08 06:27:25 -0600 received badge  Supporter (source)
2016-11-08 06:27:21 -0600 marked best answer Picture and Samples Sizes opencv_traincascade

Hello OpenCV Community,

i know there are millions Questions and Answers to the topic opencv_traincascade and i read and searched as much as i could. But i am still not sure about this, so I would like to ask this specific question.

Topic Background:

I try to train a Person Recognition based on den cv::CascadeClassifier in a specific environment.

I have 4000 positives samples of a person in the Format 48x96. (the Picture is just the Person)

I have 200 negative samples of the environment in a big Format (e.g. 480x270)

Questions:

  1. Do i need to cut the negative Samples in many, many small Pictures with 48x96 or is opencv_traincascade.exe doing this by itself?

  2. My info.txt looks like this: "rawdata/img1 1 0 0 48 96" Is this correct when the whole picture is a person?

  3. The arguments "-w" "-h" in opencv_createsamples.exe and opencv_traincascade.exe have to be 48x96?

  4. The arguments "-numPos" "-numNeg" in opencv_createsamples.exe and opencv_traincascade.exe have to be the Amount of Pictures i have? Or the Amount the program will create from the few i have?

I hope the Questions are understandable. I am still new to OpenCV. Thank you very much,

Kind regards, Derrick

2016-11-08 06:27:20 -0600 received badge  Scholar (source)
2016-10-26 13:11:07 -0600 commented answer Picture and Samples Sizes opencv_traincascade

Do you have any Idea where the Problem is??? It has to be the Format, when i try it with 20x20 its very fast

PARAMETERS:

cascadeDirName: cascades

vecFileName: vector/posvector.vec

bgFileName: bg.txt

numPos: 200

numNeg: 400

numStages: 15

precalcValBufSize[Mb] : 1024

precalcIdxBufSize[Mb] : 1024

acceptanceRatioBreakValue : -1

stageType: BOOST

featureType: HAAR

sampleWidth: 48

sampleHeight: 96

boostType: GAB

minHitRate: 0.995

maxFalseAlarmRate: 0.5

weightTrimRate: 0.95

maxDepth: 1

maxWeakCount: 100

mode: BASIC

Number of unique features given windowSize [48,96] : 10256640

2016-10-26 13:09:27 -0600 commented answer Picture and Samples Sizes opencv_traincascade

I tried it like this with just a few sample but it needs very long to calculate (about 25min to this point):

===== TRAINING 0-stage =====

<begin< p="">

POS count : consumed 200 : 200

NEG count : acceptanceRatio 400 : 1

Precalculation time: 9.345

+----+---------+---------+

| N | HR | FA |

+----+---------+---------+

| 1| 1| 1|

+----+---------+---------+

| 2| 1| 1|

+----+---------+---------+

| 3| 1| 1|

+----+---------+---------+