Lines Matching refs:MAT
41 static Mat argsort(InputArray _src, bool ascending=true)
43 Mat src = _src.getMat();
49 Mat sorted_indices;
54 static Mat asRowMatrix(InputArrayOfArrays src, int rtype, double alpha=1, double beta=0) {
57 String error_message = "The data is expected as InputArray::STD_VECTOR_MAT (a std::vector<Mat>) or _InputArray::STD_VECTOR_VECTOR (a std::vector< std::vector<...> >).";
64 return Mat();
68 Mat data((int)n, (int)d, rtype);
77 Mat xi = data.row(i);
92 Mat src = _src.getMat();
95 Mat dst = _dst.getMat();
97 Mat originalCol = src.col(indices[idx]);
98 Mat sortedCol = dst.col((int)idx);
103 static Mat sortMatrixColumnsByIndices(InputArray src, InputArray indices) {
104 Mat dst;
112 Mat _src = src.getMat();
129 Mat _src = src.getMat();
146 Mat m = src.getMat();
171 Mat LDA::subspaceProject(InputArray _W, InputArray _mean, InputArray _src) {
173 Mat W = _W.getMat();
174 Mat mean = _mean.getMat();
175 Mat src = _src.getMat();
190 Mat X, Y;
196 Mat r_i = X.row(i);
201 gemm(X, W, 1.0, Mat(), 0.0, Y);
208 Mat LDA::subspaceReconstruct(InputArray _W, InputArray _mean, InputArray _src)
211 Mat W = _W.getMat();
212 Mat mean = _mean.getMat();
213 Mat src = _src.getMat();
228 Mat X, Y;
232 gemm(Y, W, 1.0, Mat(), 0.0, X, GEMM_2_T);
236 Mat r_i = X.row(i);
258 Mat _eigenvalues;
261 Mat _eigenvectors;
905 Mat tmp;
930 Mat eigenvalues() { return _eigenvalues; }
932 Mat eigenvectors() { return _eigenvectors; }
986 Mat src = _src.getMat();
990 Mat tmp = _lbls.getMat();
996 Mat data;
1034 Mat meanTotal = Mat::zeros(1, D, data.type());
1036 std::vector<Mat> meanClass(C);
1041 meanClass[i] = Mat::zeros(1, D, data.type()); //! Dx1 image vector
1045 Mat instance = data.row(i);
1060 Mat instance = data.row(i);
1064 Mat Sw = Mat::zeros(D, D, data.type());
1067 Mat Sb = Mat::zeros(D, D, data.type());
1069 Mat tmp;
1075 Mat Swi = Sw.inv();
1077 Mat M;
1078 gemm(Swi, Sb, 1.0, Mat(), 0.0, M);
1090 _eigenvalues = Mat(_eigenvalues, Range::all(), Range(0, _num_components));
1091 _eigenvectors = Mat(_eigenvectors, Range::all(), Range(0, _num_components));
1099 case _InputArray::MAT:
1110 Mat LDA::project(InputArray src) {
1111 return subspaceProject(_eigenvectors, Mat(), _dataAsRow ? src : src.getMat().t());
1115 Mat LDA::reconstruct(InputArray src) {
1116 return subspaceReconstruct(_eigenvectors, Mat(), _dataAsRow ? src : src.getMat().t());