Ask Your Question

floyd's profile - activity

2016-05-12 11:09:37 -0500 asked a question traincascade stoops without any error

i'm trying to do a haartraining using the following command:

opencv_traincascade -data xml -vec vec.vec -bg negext3000.txt -numPos 500 -numNeg 3000 -precalcValBufSize 1024 -precalcIdxBufSize 2048 -featureType LBP -w 48 -h 48

but always it crashes and i have to break it manually or it is runs endless and nothing more is happen.

PARAMETERS:
cascadeDirName: xml
vecFileName: vec.vec
bgFileName: negext3000.txt
numPos: 500
numNeg: 3000
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 2048
acceptanceRatioBreakValue : -1
stageType: BOOST
featureType: LBP
sampleWidth: 48
sampleHeight: 48
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   500 : 500
NEG count : acceptanceRatio    3000 : 1
^C

I have tried so much:

  • various values for -w -h
  • different background images and sizes
  • different num of stages
  • different vec-files (with background, without background, with distortion)
  • different num values for the vec-files

i use a OS X 10.7.5 and open cv 3.1.0 so what can i try to get it running on OSX? should i switch to open cv 2.4.12?

2016-03-14 06:06:53 -0500 asked a question How to detect more than one object in one image with surf detector

in which direction i have to think to solve that problem? with which functions is that may possible? what else do i may need? it is not about face detection. the objects are from the same and if that is solved from different classes.

thanks in advance for any suggestions.

floyd

2016-03-06 14:00:18 -0500 commented question cannot declare field 'std::pair<const std::basic_string<char>, cv::ml::SVM>::second' to be of abstract type 'cv::ml::SVM'

indeed i did have a unused map of svm's left in the code. all problems are gone. a new problem appeared, but so far for today and the new problem i can handle on my own. thanks a lot. :D :D

2016-03-06 13:00:58 -0500 commented question cannot declare field 'std::pair<const std::basic_string<char>, cv::ml::SVM>::second' to be of abstract type 'cv::ml::SVM'

that's the problem, i do not know what is going on. the only error appearing is the title of that question. the location of the error is in the header file stl_pair.h. That is why i wrote my code seem to be okay. the location is out of my code. and all the informations shown in the screenshot are out of my code, too.

2016-03-06 12:44:23 -0500 commented question cannot declare field 'std::pair<const std::basic_string<char>, cv::ml::SVM>::second' to be of abstract type 'cv::ml::SVM'

I'm doing like you did it here: link, a pair i do nowhere have.

2016-03-06 12:03:10 -0500 commented question cannot declare field 'std::pair<const std::basic_string<char>, cv::ml::SVM>::second' to be of abstract type 'cv::ml::SVM'

i do agree with you my code is probably (or definitely) not okay. but way is there no reference to my code? so i don't know which part of the code i need to post.

2016-03-06 11:44:13 -0500 received badge  Editor (source)
2016-03-06 11:43:43 -0500 asked a question cannot declare field 'std::pair<const std::basic_string<char>, cv::ml::SVM>::second' to be of abstract type 'cv::ml::SVM'

hey everybody,

i am really new to openCV and i am trying to implement a surf detector using openCV 3.1 and i getting always after building my project in eclipse the error message above. There are a lot of information i getting, too. Most of them concerning to ml.hpp.

image description

My code seem to be okay. The only error appearing references to "line 102, external location: /usr/local/Cellar/gcc48/4.8.2/lib/gcc/x86_64-apple-darwin11.4.2/4.8.2/include/c++/bits/stl_pair.h C/C++ Problem"

I do not know what to do cause the error is not my fault?

desperate floyd

EDIT 1

void categorizer::train_classifiers() {
// Set the vocabulary for the BOW descriptor extractor
bowDescriptorExtractor -> setVocabulary(vocab);
// Extract BOW descriptors for all training images and organize them into positive and negative samples for each category
make_pos_neg();

for(int i = 0; i < categories; i++) {
    string category = category_names[i];

    // Positive training data has labels 1
    Mat train_data = positive_data[category];
    Mat train_labels = Mat::ones(train_data.rows, 1, CV_32S);
    // Negative training data has labels 0
    train_data.push_back(negative_data[category]);
    Mat m = Mat::zeros(negative_data[category].rows, 1, CV_32S);
    train_labels.push_back(m);

    svm = ml::SVM::create();
    svm->setType(ml::SVM::C_SVC);
    svm->setKernel(ml::SVM::POLY);
    svm->setGamma(3);

    svm->train( train_data , ml::ROW_SAMPLE , train_labels );

    cout << "Trained and saved SVM for category " << category << endl;
}

}