2016-09-20 06:53:51 -0600 | received badge | ● Famous Question (source) |
2015-11-15 01:17:35 -0600 | received badge | ● Notable Question (source) |
2015-06-09 08:50:58 -0600 | received badge | ● Popular Question (source) |
2014-07-31 14:47:39 -0600 | commented answer | Train SVM with HOG descriptors Thanks, I posted another question related to the code that you provided. Any idea? http://answers.opencv.org/question/38498/xml-data-to-appropriate-type-of-container/ |
2014-07-31 14:46:49 -0600 | asked a question | xml data to appropriate type of container. Hi, i modified your code little bit, but I am not sure this is correct. I added two lines to load my trained svm values. But it seems to not working for the line const CvSVMDecisionFunc* df = svm1.decision_func; Any idea? Thank you for your time. void LinearSVM::get_primal_form_support_vector(std::vector<float>& support_vector) const { } you might need this below class as well. class LinearSVM : public CvSVM{ public: }; |
2014-07-31 10:36:32 -0600 | received badge | ● Editor (source) |
2014-07-31 10:34:05 -0600 | asked a question | Train SVM with HOG descriptors Hi, I have a question. I am trying to detect people from background images, and I have some problem to do it. Upto now, I put 450 positive images, and 1240 negative images to train my SVM after I get HOG Descriptors for them. To get HOG Descriptors First, I re-size every image to 64 x 128. Then I use HOGDescriptor::compute function with Size(8,8) for every image. After this, I labeled positive as 1 and negative as -1. Upto here I get HOGfeaturematrix that has Size(450+1240, 3780) and Label that has Size(450+1240, 1) Then I trained my SVM as below code. CvSVMParams params; params.svm_type = CvSVM::C_SVC; params.kernel_type = CvSVM::LINEAR; params.term_crit = cvTermCriteria(CV_TERMCRIT_ITER, 100, 1e-6); // Train the SVM CvSVM svma; svma.train(HOGfeaturematrix, Label, Mat(), Mat(), params); svma.save('result.txt'); When I look into the result.txt file, I can see as below.. %YAML:1.0 my_svm: !!opencv-ml-svm svm_type: C_SVC kernel: { type:LINEAR } C: 1. term_criteria: { epsilon:2.2204460492503131e-016, iterations:100 } var_all: 3780 var_count: 3780 class_count: 2 class_labels: !!opencv-matrix sv_total: 1 support_vectors: - [ some numbers .. total 3780 numbers ] decision_functions: And I use values of support_vectors as below vector<float> getThisPeopleDetector() { static const float detector[] = { all 3780 numbers }; } to pass ::setSVMDetector function as below. hog.setSVMDetector(getThisPeopleDetector()); But the result is bad compared to hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector()); What is my problem ? Thank you for your time. |