Fix for CvSVM tutorial documentation (Bugfix #3973)
Description
[Liquid Syntax Error] Variable '{{501, 10}' was not properly terminated with regexp: /\}\}/
In the OpenCV machine learning tutorial:
[[http://docs.opencv.org/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.html#explanation]]
**Explanation**
*1.Set up the training data*
The training data of this exercise is formed by a set of labeled 2D-points that belong to one of two different classes; one of the classes consists of one point and the other of three points.
float labels[4] = {1.0, -1.0, -1.0, -1.0};
float trainingData[4][2] = {{501, 10}, {255, 10}, {501, 255}, {10, 501}};
The function CvSVM::train that will be used afterwards requires the training data to be stored as Mat objects of floats. Therefore, we create these objects from the arrays defined above:
-Mat trainingDataMat(3, 2, CV_32FC1, trainingData);-
-Mat labelsMat (3, 1, CV_32FC1, labels);-
The Mat dimension initiating is wrong. It should be fixed as:
+Mat trainingDataMat(4, 2, CV_32FC1, trainingData);+
+Mat labelsMat (4, 1, CV_32FC1, labels);+
Associated revisions
Merge pull request #3973 from xsorifc28:patch-1