У меня есть проект, который я хочу обнаружить в изображениях; моя цель - использовать функции HOG. Используя OpenCV SVM-реализацию, я смог найти код для обнаружения людей, и я прочитал некоторые статьи о настройке параметров, чтобы обнаружить объект вместо людей. К сожалению, я не мог этого сделать по нескольким причинам; во-первых, я, вероятно, неправильно настроил параметры, во-вторых, я не хороший программист на С++, но я должен сделать это с помощью С++/OpenCV... здесь вы можете найти код для обнаружения функций HOG для людей с помощью С++/OpenCV.
Скажем, что я хочу обнаружить объект в этом изображении. Теперь я покажу вам, что я пытался изменить в коде, но это не сработало со мной.
Код, который я пытался изменить:
HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
Я попытался изменить getDefaultPeopleDetector()
со следующими параметрами, но это не сработало:
(Size(64, 128), Size(16, 16), Size(8, 8), Size(8, 8), 9, 0,-1, 0, 0.2, true, cv::HOGDescriptor::DEFAULT_NLEVELS)
Затем я попытался создать вектор, но когда я хотел распечатать результаты, он кажется пустым.
vector<float> detector;
HOGDescriptor hog(Size(64, 128), Size(16, 16), Size(8, 8), Size(8, 8), 9, 0,-1, 0, 0.2, true, cv::HOGDescriptor::DEFAULT_NLEVELS);
hog.setSVMDetector(detector);
Пожалуйста, мне нужна помощь в решении этой проблемы.