mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Fixed suggestion of bugfix 3431
Seems correct to me and builds fine
This commit is contained in:
parent
e88253ccad
commit
12c25b9310
@ -32,13 +32,13 @@ int main()
|
|||||||
for (int i = 0; i < image.rows; ++i)
|
for (int i = 0; i < image.rows; ++i)
|
||||||
for (int j = 0; j < image.cols; ++j)
|
for (int j = 0; j < image.cols; ++j)
|
||||||
{
|
{
|
||||||
Mat sampleMat = (Mat_<float>(1,2) << i,j);
|
Mat sampleMat = (Mat_<float>(1,2) << j,i);
|
||||||
float response = SVM.predict(sampleMat);
|
float response = SVM.predict(sampleMat);
|
||||||
|
|
||||||
if (response == 1)
|
if (response == 1)
|
||||||
image.at<Vec3b>(j, i) = green;
|
image.at<Vec3b>(i,j) = green;
|
||||||
else if (response == -1)
|
else if (response == -1)
|
||||||
image.at<Vec3b>(j, i) = blue;
|
image.at<Vec3b>(i,j) = blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the training data
|
// Show the training data
|
||||||
|
Loading…
Reference in New Issue
Block a user