title: absdiff work on grayscale and not BGR colourspace
body: <p>The difficulty I am facing is a live background subtraction. Have tried many methods but to no avail. The task I am trying to achieve is to remove a background image that the camera have snapped with a real time video that the camera is streaming. </p>
  
  <p><code>absdiff</code> is the method that I am using for my background subtraction currently as it seems to produce the best results so far.</p>
  
  <p>My code is as show:</p>
  
  <pre><code> while(1)
  {
      capture&gt;&gt;imagef;
      imshow("image with foreground", imagef);
      imagef.convertTo(imagef, CV_8UC3);
      //cvtColor(imagef, imagef, CV_BGR2GRAY);
  
      absdiff(imagef,imageb, imageFinal); //imageb is the background image
      imshow("after diff", imageFinal);
  
  
      //cvtColor(imageFinal, imageFinal, CV_BGR2GRAY); //change to grayscale
  
  
      threshold(imageFinal, imageFinal, 20, 255, CV_THRESH_BINARY); // change to grayscale
  
  
      imshow("Camera Window",imageFinal); //show video
  
  
      int key = cvWaitKey(10);     //Capture Keyboard stroke
      if (char(key) == 27)
      {
          break;      //If you hit ESC key loop will break.
      }
  
  }
  </code></pre>
  
  <p>This code however returns a blank image regardless of whether the camera video have new images introduced to it. </p>
  
  <p>Note that if I uncomment the <code>cvtColor</code>, convert both imagef(video frame) and imageb(static image) to grayscale before processing, i am able to retrieve the diff between the new image, however, there will be information loss due to similar intensity, yet if I lower down the threshold, the video have horizontal moving lines(in bright conditions, hence I can set it too low).</p>
  
  <p>I wish to ask if absdiff only work on grayscale image? If it works on BGR images too, then where did I go wrong?</p>