LSD: Line Segment Detector compiled to js with emscripten
Last updated 4 years ago by juul .
AGPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install line-segment-detector 
SYNC missed versions from official npm registry.

This is a javascript version of the famous LSD (Line Segment Detector) algorithm. It was created using emscripten to compile the official C version into javascript and adding a bit of wrapper code to convert between javascript and C data types.

Currently only the main lsd() function call is available.


See example.js


You don't need to compile this unless you change the C code. Just use the pre-compiled index.js and index.*.js files.

First install emscripten. On a Ubuntu 14.04 the following should work:

sudo apt-get install emscripten

On Ubuntu 16.04 there appears to be an issue with emscripten. You'll need to build emscripten using emsdk:

sudo apt-get install cmake build-essential git
wget ""
tar cvzf emsdk-portable.tar.gz
cd emsdk-portable/
./emsdk update
./emsdk install latest
./emsdk activate latest
source ./

Now get the lsd source code:

cd line-segment-detector/
wget ""

To build:



License is AGPLv3

Current Tags

  • 0.0.4                                ...           latest (4 years ago)

3 Versions

  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
Dev Dependencies (0)
Dependents (0)

Copyright 2014 - 2016 © |