title: GrabCut - bgdModel & fgdModel empty - Assertion error
body: <p>I am attempting image segmentation using GrabCut algorithm in OpenCV2.1 (C++)</p>
  
  <p>Here my code:</p>
  
  <pre><code>Mat rgbWorkImage = imread(argv[1]);
  Mat mask;
  mask = Scalar(0);
  Mat bgdModel, fgdModel;
  Rect rect = Rect(Point(0,0), imageSize);
  grabCut(rgbWorkImage, mask, rect, bgdModel, fgdModel, 0, GC_INIT_WITH_RECT);
  grabCut(rgbWorkImage, mask, rect, bgdModel, fgdModel, 2, GC_EVAL);
  </code></pre>
  
  <p>Unfortunately I am getting this runtime error:</p>
  
  <pre><code>OpenCV Error: Assertion failed (!bgdSamples.empty() &amp;&amp; !fgdSamples.empty()) in initGMMs, file /build/buildd/opencv-2.1.0/src/cv/cvgrabcut.cpp, line 368
  terminate called after throwing an instance of 'cv::Exception'
    what():  /build/buildd/opencv-2.1.0/src/cv/cvgrabcut.cpp:368: error: (-215) !bgdSamples.empty() &amp;&amp; !fgdSamples.empty() in function initGMMs
  </code></pre>
  
  <p>What am I missing here?</p>
  
  <p>Thanks</p>