trainHOG icon indicating copy to clipboard operation
trainHOG copied to clipboard

Running the classifer

Open snehalvartak opened this issue 8 years ago • 1 comments

How do I test the classifier once it has been compiled as per the steps mentioned in the tutorial?

snehalvartak avatar Apr 05 '17 18:04 snehalvartak

How do I test the classifier once it has been compiled as per the steps mentioned in the tutorial?

after training you can get "cvHOGClassifier.yaml" in the genfile. the you can load it with : hog.load("cvHOGClassifier.yaml") here is an example:

cv::Mat gray_image;
cv::cvtColor(res_image, gray_image, cv::COLOR_BGR2GRAY);
cv::HOGDescriptor hog;  
hog.load("cvHOGClassifier.yaml");
std::vector<cv::Rect> found, found_filtered;
hog.detectMultiScale(gray_image, found, 1.3, cv::Size(2,2), cv::Size(4,4), 1.05, 10);

chrisHuxi avatar Feb 14 '19 19:02 chrisHuxi