title: K-means and EM algorithms
body: <p>How can I implement the k-means &amp; EM algorithms without calling the openCV functions to do the image segmentation?</p>
  
  <p>I begin with this code :</p>
  
  <pre><code>#include opencv2/highgui/highgui.hpp
  #include iostream
  
  using namespace cv;
  using namespace std;
  
  int main()
  {
      Mat img = imread("testImage.png", 0);
      Mat label_img;
      label_img.create(img.cols, img.rows, CV_8UC1);
  }
  </code></pre>
  
  <p>How can I continue ?</p>