All Projects → LingDong- → skeletonization-js

LingDong- / skeletonization-js

Licence: other
Javascript implementation of image skeletonization

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to skeletonization-js

skeletor
3D skeleton extraction from meshes.
Stars: ✭ 115 (+238.24%)
Mutual labels:  skeletonization
kimimaro
Skeletonize densely labeled 3D image segmentations with TEASAR.
Stars: ✭ 85 (+150%)
Mutual labels:  skeletonization
Basic-Image-Processing
Implementation of Basic Digital Image Processing Tasks in Python / OpenCV
Stars: ✭ 102 (+200%)
Mutual labels:  skeletonization
SkeletonMatching
This repository implements skeleton matching algorithm.
Stars: ✭ 30 (-11.76%)
Mutual labels:  skeletonization
Py BL MeshSkeletonization
Mesh Skeleton Extraction Using Laplacian Contraction
Stars: ✭ 32 (-5.88%)
Mutual labels:  skeletonization
kalwalt-interactivity-AR
Some various experiments with Ar.js and Three.js
Stars: ✭ 65 (+91.18%)
Mutual labels:  opencvjs
vuletube
Starter project for vue in combination with typescript. Getting response for youtube search. Call server part for saving videos. Use videos in three.js 3d port view. Control vuletube site with hands (NUI) also with voice command.
Stars: ✭ 12 (-64.71%)
Mutual labels:  opencvjs

skeletonization.js library

GPU-powered image skeletonization for the web.

Based on orginal C++ code by Zhang-Suen.

With GPU support from gpu.js.

Uses OpenCV.js.

Checkout the live demo at skeletonization-js.glitch.me.

Usage

In your HTML file:

<!-- Include OpenCV.js -->
<script src="https://docs.opencv.org/3.4/opencv.js"></script>

<!-- Include gpu.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gpu.js/1.10.4/gpu.min.js"></script>

<!-- Include skeletonization.js -->
<script src="https://skeletonization-js.glitch.me/skeletonization.js"></script>

In your Javascript file:

// Usage with HTML Canvas:

// setup skeletonization:
skeletonization.setup(
  256, // output width
  256  // output height
);

// skeletonize a canvas element specified by its id:
skeletonization.skeletonize("inputCanvasId", {
  preprocess: true, // whether or not to preprocess the
                    // source image (blur, threshold, etc.)
    blur: 5,        // if preprocess, radius of blurring to apply
    threshold: 128, // if preprocess, binary threshold to apply
    invert: false,  // if preprocess, invert the image (foreground
                    // should be white, background should be black)
  outputCanvasId: "outputCanvasId", // id of canvas on which output
                                    // will be displayed
  bbox: [0,0,256,256], // bounding box (xmin,ymin,xmax,ymax) of
                       // the region to apply skeletonization,
                       // leave undefined to apply to whole image
})

You can also skeletonize cv::Mat, e.g. in an OpenCV.js project:

// Usage with OpenCV.js:

// setup skeletonization
skeletonization.setup(
  256, // output width
  256  // output height
);

// read the image with OpenCV.js
var im = cv.imread("inputCanvasId");

// ... (custom preprocessing)

// skeletonize the cv::Mat
// skeletonize modifies the input cv::Mat,
// so save a copy if you still need the original
skeletonization.skeletonize(im, {
  preprocess: true, // whether or not to preprocess the
                    // source image (blur, threshold, etc.)
    blur: 5,        // if preprocess, radius of blurring to apply
    threshold: 128, // if preprocess, binary threshold to apply
    invert: false,  // if preprocess, invert the image (foreground
                    // should be white, background should be black)
  bbox: [0,0,256,256], // bounding box (xmin,ymin,xmax,ymax) of
                       // the region to apply skeletonization,
                       // leave undefined to apply to whole image
})

// ... (custom postprocessing)

// display the result
cv.imshow("outputCanvasId",im);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].