decomposition.cpp
Go to the documentation of this file.
00001 #include "thirdparty/decomposition.hpp"
00002 #include "thirdparty/helper.hpp"
00003 
00004 void EigenvalueDecomposition::compute(InputArray src)
00005 {
00006         Mat tmp;
00007         // Convert the given input matrix to double. Is there any way to
00008         // prevent allocating the temporary memory? Only used for copying
00009         // into working memory and deallocated after.
00010         src.getMat().convertTo(tmp, CV_64FC1);
00011         // Get dimension of the matrix.
00012         this->n = tmp.cols;
00013         // Allocate the matrix data to work on.
00014         this->H = alloc_2d<double>(n, n);
00015         // Now safely copy the data.
00016         for (int i = 0; i < tmp.rows; i++)
00017         {
00018                 for (int j = 0; j < tmp.cols; j++)
00019                 {
00020                         this->H[i][j] = tmp.at<double>(i, j);
00021                 }
00022         }
00023         // Deallocates the temporary matrix before computing.
00024         tmp.release();
00025         // Performs the eigenvalue decomposition of H.
00026         compute();
00027 }
00028 


cob_people_detection
Author(s): Richard Bormann , Thomas Zwölfer
autogenerated on Fri Aug 28 2015 10:24:12