title: How to call LSD (LineSegmentDetector) from a c language program?
body: <p>i'm using LSD to detect straight lines in an image, the code that i have downloaded contains a Minimal example of calling LSD but it's static (i.e it outputs only the value in the main function) i want to apply the code on a video, that's the minimal example that outputs static results.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "lsd.h"
  
  int main(void)
  {
    image_double image;
    ntuple_list out;
    unsigned int x,y,i,j;
    unsigned int X = 512;  /* x image size */
    unsigned int Y = 512;  /* y image size */
  
    /* create a simple image: left half black, right half gray */
    image = new_image_double(X,Y);
    for(x=0;x&lt;X;x++)
      for(y=0;y&lt;Y;y++)
        image-&gt;data[ x + y * image-&gt;xsize ] = x&lt;X/2 ? 0.0 : 64.0; /* image(x,y) */
     IplImage* imgInTmp = cvLoadImage("C:\Documents and Settings\Eslam farag\My Documents\Visual Studio 2008\Projects\line\hand.JPEG", 0);
  
    /* call LSD */
  
    out = lsd(image);
  
    /* print output */
    printf("%u line segments found:\n",out-&gt;size);
    for(i=0;i&lt;out-&gt;size;i++)
      {
        for(j=0;j&lt;out-&gt;dim;j++)
          printf("%f ",out-&gt;values[ i * out-&gt;dim + j ]);
        printf("\n");
      }
  
    /* free memory */
    free_image_double(image);
    free_ntuple_list(out);
  
    return 0;
  }
  </code></pre>
  
  <p>if anyone can help me to apply the code on video i will be pleased.thanks
  best regards,</p>