[英]Train SVM with OpenCV using colour histograms
I'm very new to OpenCV, and i want to create simple object detector, that uses SVM. 我是OpenCV的新手,我想创建一个使用SVM的简单对象检测器。 Instead of HOG, i would like to extract from my object color histograms(for example), but i couldn't find any information about it for OpenCV, everywhere is using HOG.
我想从我的对象颜色直方图中提取HOG而不是HOG(例如),但是我找不到OpenCV的任何有关它的信息,到处都在使用HOG。
And my second question: is Python implemenation for SVM has less functionality than C++ (both for OpenCV) ? 我的第二个问题:SVM的Python实现是否比C ++的功能更少(均为OpenCV)?
You can use the OpenCV function calcHist
to compute histograms. 您可以使用OpenCV函数
calcHist
计算直方图。
calcHist(&bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate );
where, 哪里,
Refer to the docs for more information. 请参阅文档以获取更多信息。
You can also look at this answer which discusses C++ OpenCV SVM implementation and this answer which discusses Python OpenCV SVM implementation to get started. 您也可以看看这个答案 ,其中讨论了C ++ OpenCV的SVM执行和这个答案 ,其中讨论了Python的OpenCV的SVM实现上手。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.