title: SLIC c++ segmentation
body: <p>Im trying to segment an image using SLIC in OpenCV. Im trying to use the following function:</p>
  
  <pre><code>void vl_slic_segment    (   vl_uint32 *     segmentation,
  float const *   image,
  vl_size     width,
  vl_size     height,
  vl_size     numChannels,
  vl_size     regionSize,
  float   regularization,
  vl_size     minRegionSize 
  )
  </code></pre>
  
  <p>the #include is fine and the linking to libraries is fine. I just need to know how can I pass the image to this function. the image parameter in this function is of type <code>float const *</code> and I dont know how to convert the image to this type.</p>
  
  <p>Here is how i am loading the image into the code:</p>
  
  <pre><code>IplImage *image = cvLoadImage("train.tif", 1);
  </code></pre>
  
  <p>and here is the whole code:</p>
  
  <pre><code>extern "C" {
    #include &lt;/home/me/Downloads/vlfeat-0.9.17/vl/slic.h&gt;
  }
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;opencv2/opencv.hpp&gt;
  #include&lt;opencv/highgui.h&gt;
  
  using namespace std;
  using namespace cv;
  
  int main () {
      IplImage *image = cvLoadImage("train.tif", 1);
  
     vl_uint32 * seg;
  
     vl_slic_segment(seg,(const float *)image,image-&gt;width,image-&gt;height,image-&gt;nChannels,15,0.1,1);
  
    waitKey(0);
  }
  </code></pre>
  
  <p>and also i dont know if i am using the <code>vl_uint32 * seg</code> correctly. Please if someone has an example or sample code to do this segmentation.</p>
  
  <p>Thanks !!</p>