Definition at line 306 of file ColorSegmentation.h. References Impala::Core::Array::pixgroup::cov, Impala::Core::Matrix::MatrixTem< C >::covariance(), Impala::Core::Matrix::MatrixTem< C >::getRow(), Impala::Core::Array::pixgroup::idx, Impala::Core::Array::pixgroup::m, Impala::Core::Matrix::MatrixTem< C >::nCol(), Impala::Core::Array::pixgroup::nrPixInGroup, and Impala::Core::Matrix::MatrixTem< C >::setRow(). Referenced by mergeRegions(). 00306 { 00307 00308 int i ; 00309 int nn = toMerge.nrPixInGroup+region.nrPixInGroup; 00310 00311 // add references 00312 int j=0 ; 00313 for (i=toMerge.nrPixInGroup;i<nn; i++) 00314 toMerge.idx[i] = region.idx[j++]; 00315 00316 toMerge.nrPixInGroup = nn; 00317 00318 region.nrPixInGroup = 0; 00319 00320 //recompute the covariance matrix 00321 MatrixDouble rgPixMatrix(nn, m.nCol(), 0.0) ; 00322 00323 // create a matrix of the pixels 00324 for(i=0;i<nn;i++) 00325 rgPixMatrix.setRow(i, m.getRow(toMerge.idx[i]) ) ; 00326 00327 // set covariance and mean vector 00328 VectorDouble mean ; 00329 toMerge.cov = rgPixMatrix.covariance(mean) ; 00330 00331 toMerge.m = mean ; 00332 }
Here is the call graph for this function:
|