title: opencv : create matrix or vector of matrices
body: <p>I have the following code, which is a part of the algorithm that I am following. as you see I need to do some calculation for 10 different bands. and will end up with a matrix for each band that I need to recreate an image from it, the problem is that I dont know how to create/hold the 10 different matrix on the while loop, then after the while loop I can construct the images one by one. if you have any idea please let me know thank you</p>
  
  <pre><code>cv::Mat _reconstructionMatrix(height,width,CV_8UC1);
  _reconsPointer = _reconstructionMatrix.ptr&lt;uchar&gt;(0);   
  
      while(_bandIteration&lt;_bandsNumber){                     
  if(_mainMatrix.isContinuous())
  {
      nCols *= nRows;
      nRows = 1;
  }
  //for all the pixels 
  for(int i = 0; i &lt; nRows; i++)
  {           
      p = _mainMatrix.ptr&lt;uchar&gt;(i);
      //in the images
      for (int  j = 0; j &lt; nCols; j++)
      {               
          if(_pCounter&lt;_totalImgNO){              
              ....
          }else{                                                      
              ...
  
              _reconsPointer[_resultFlag]=_summation; 
              _resultFlag++;
  
              ...             
          }
      }                   
  }           
  
  _bandIteration++;
  }
  </code></pre>