Deleted all trailing whitespace.
This commit is contained in:
@@ -10,7 +10,7 @@ In this tutorial you will learn how to:
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
+ Use the OpenCV functions :svms:`CvSVM::train <cvsvm-train>` to build a classifier based on SVMs and :svms:`CvSVM::predict <cvsvm-predict>` to test its performance.
|
||||
+ Use the OpenCV functions :svms:`CvSVM::train <cvsvm-train>` to build a classifier based on SVMs and :svms:`CvSVM::predict <cvsvm-predict>` to test its performance.
|
||||
|
||||
What is a SVM?
|
||||
==============
|
||||
@@ -36,14 +36,14 @@ Then, the operation of the SVM algorithm is based on finding the hyperplane that
|
||||
|
||||
.. image:: images/optimal-hyperplane.png
|
||||
:alt: The Optimal hyperplane
|
||||
:align: center
|
||||
:align: center
|
||||
|
||||
How is the optimal hyperplane computed?
|
||||
=======================================
|
||||
|
||||
Let's introduce the notation used to define formally a hyperplane:
|
||||
|
||||
.. math::
|
||||
.. math::
|
||||
f(x) = \beta_{0} + \beta^{T} x,
|
||||
|
||||
where :math:`\beta` is known as the *weight vector* and :math:`\beta_{0}` as the *bias*.
|
||||
@@ -106,7 +106,7 @@ Explanation
|
||||
.. code-block:: cpp
|
||||
|
||||
Mat trainingDataMat(3, 2, CV_32FC1, trainingData);
|
||||
Mat labelsMat (3, 1, CV_32FC1, labels);
|
||||
Mat labelsMat (3, 1, CV_32FC1, labels);
|
||||
|
||||
2. **Set up SVM's parameters**
|
||||
|
||||
@@ -143,7 +143,7 @@ Explanation
|
||||
.. code-block:: cpp
|
||||
|
||||
Vec3b green(0,255,0), blue (255,0,0);
|
||||
|
||||
|
||||
for (int i = 0; i < image.rows; ++i)
|
||||
for (int j = 0; j < image.cols; ++j)
|
||||
{
|
||||
@@ -152,8 +152,8 @@ Explanation
|
||||
|
||||
if (response == 1)
|
||||
image.at<Vec3b>(j, i) = green;
|
||||
else
|
||||
if (response == -1)
|
||||
else
|
||||
if (response == -1)
|
||||
image.at<Vec3b>(j, i) = blue;
|
||||
}
|
||||
|
||||
@@ -184,5 +184,5 @@ Results
|
||||
|
||||
.. image:: images/result.png
|
||||
:alt: The seperated planes
|
||||
:align: center
|
||||
:align: center
|
||||
|
||||
|
@@ -5,9 +5,9 @@
|
||||
|
||||
Use the powerfull machine learning classes for statistical classification, regression and clustering of data.
|
||||
|
||||
.. include:: ../../definitions/tocDefinitions.rst
|
||||
.. include:: ../../definitions/tocDefinitions.rst
|
||||
|
||||
+
|
||||
+
|
||||
.. tabularcolumns:: m{100pt} m{300pt}
|
||||
.. cssclass:: toctableopencv
|
||||
|
||||
@@ -18,7 +18,7 @@ Use the powerfull machine learning classes for statistical classification, regre
|
||||
|
||||
*Author:* |Author_FernandoI|
|
||||
|
||||
Learn what a Suport Vector Machine is.
|
||||
Learn what a Suport Vector Machine is.
|
||||
|
||||
============ ==============================================
|
||||
|
||||
@@ -26,7 +26,7 @@ Use the powerfull machine learning classes for statistical classification, regre
|
||||
:height: 90pt
|
||||
:width: 90pt
|
||||
|
||||
+
|
||||
+
|
||||
.. tabularcolumns:: m{100pt} m{300pt}
|
||||
.. cssclass:: toctableopencv
|
||||
|
||||
@@ -51,6 +51,6 @@ Use the powerfull machine learning classes for statistical classification, regre
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
|
||||
../introduction_to_svm/introduction_to_svm
|
||||
../non_linear_svms/non_linear_svms
|
||||
|
Reference in New Issue
Block a user