0

LSD is a linear-time Line Segment Detector giving subpixel accurate results. It is designed to work on any digital image without parameter tuning. It controls its own number of false detections: On average, one false alarms is allowed per image. the package includes a little example,

can I make is work in android? and if i can, What is the proper way?

#include <stdio.h>
#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<X;x++)
    for(y=0;y<Y;y++)
      image->data[ x + y * image->xsize ] = x<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->size);
  for(i=0;i<out->size;i++)
    {
      for(j=0;j<out->dim;j++)
        printf("%f ",out->values[ i * out->dim + j ]);
      printf("\n");
    }

  /* free memory */
  free_image_double(image);
  free_ntuple_list(out);

  return 0;
}

thanks :)

  • Some more information on your problem would make it possible to help you. What have you tried? What problems have you come across? Personally I've never even heard of this line segment detector ... – Goz Mar 19 '13 at 20:14
  • this is the web: http://www.ipol.im/pub/art/2012/gjmr-lsd/ . And here you can test the code online: http://demo.ipol.im/demo/gjmr_line_segment_detector/ . The problem is that i need to use that function in an android apk – Nando Walpert Mar 21 '13 at 01:43
  • What happens when you try to compile it under the android ndk? – Goz Mar 21 '13 at 07:15

1 Answers1

0

i think if you are using c or c++ for developing your apk then simply you can include that lsd.h, its source file lsd.cpp and then you have to simply pass parameters to that line segment detector which would be enough. But in the case if you are using java for your apk then you have to do lot of modifications either u have to convert it to java classes or you have to find a alternative way to include it to your project.

sAm
  • 193
  • 1
  • 1
  • 10