i not c++ starting learn. learn looking @ other people's code.
i looking @ svm tutorial on opencv here
i not understand part on
(mat_(1,2) << j,i);
what mean mat_ (1,2)? _ represent?
why j , fed matrix? shouldn't , j, = rows , j = columns?
// show decision regions given svm vec3b green(0,255,0), blue (255,0,0); (int = 0; < image.rows; ++i) (int j = 0; j < image.cols; ++j) { mat samplemat = (mat_<float>(1,2) << j,i); float response = svm->predict(samplemat); if (response == 1) image.at<vec3b>(i,j) = green; else if (response == -1) image.at<vec3b>(i,j) = blue; }
(mat_<float>(1,2) << j,i): creates 1-by-2 matrix , fills values ofi,j.- the function
cv::mat::operator()requires specify row (i) , column (j) data goes functionpredict()uses other order. tutorial:
[...] image traversed interpreting pixels points of cartesian plane. [...]
Comments
Post a Comment