title: Getting the std deviation of multiple pictures using Opencv
body: <p>I'm trying to get the standard  deviationof multiple pictures using, OpenCV, here what I've done :</p>
  
  <p>#include 
     #include 
     #include </p>
  
  <pre><code> using namespace std;
    using namespace cv;
  
   int main(){
  cv::Mat frame,frame32f;
  char filename[40];
  cv::Mat mean;
  const int count =134;
  const int width  = 1920;
  const int height = 1080;
  cv::Mat resultframe = cv::Mat::zeros(height,width,CV_32FC3);
  cv::Mat deviationframe = cv::Mat ::zeros(height,width,CV_32FC3);
  cv::Mat temp = cv::Mat ::zeros(height,width,CV_32FC3);
  for(int i = 1 ; i&lt;= count; i++){
  //int i = 3;
  sprintf(filename,"d:\\BMdvideos\\images\\image%d.tiff",i);
  frame = imread(filename,CV_LOAD_IMAGE_COLOR);
  frame.convertTo(frame32f,CV_32FC3 );
  resultframe +=frame32f;
  frame.release();
  }
  resultframe *= (1.0/count);
  for(int j =1; j&lt;count; j++){
      sprintf(filename,"d:\\BMdvideos\\images\\image%d.tiff",j);
      frame = imread(filename,CV_LOAD_IMAGE_COLOR);
      frame.convertTo(frame32f,CV_32FC3);
      temp =(frame32f - resultframe);
      deviationframe+= temp.mul(temp);
  
      //temp.release();
  }
  imshow("devi",deviationframe);  // works
  deviationframe *= 1.0/(count -1);
  imshow("devi2",deviationframe); // works
  cv::sqrt(deviationframe,deviationframe);
  resultframe *= 1.0/255.0;
  imshow("devi3",deviationframe);// works
  deviationframe *= 1.0/255.0;
  
  imshow("mean ",resultframe);
  imshow("deviation frame ",deviationframe);// BLACK FRAME !!!!!!!!!!!!!!!!!!!
      waitKey(0);
  return 0;
  </code></pre>
  
  <p>}</p>
  
  <p>when I see what I get the resultframe"mean value " is correct but the std deviation is just wrong.  any idea what I'm doing wrong, thanks in advance for help</p>