7 ms·
Show HN: Image segmentation and background removal in JavaScript
- secondtimeuse 11y agoThis is an alpha version, I hope to improve it over the next week by incorporating ConvnetJS, to label pixels in mixed superpixels (Superpixels with both positive and negative labels). And incorporate additional functionality to such as blurring the boundary. The current restriction on the size of canvas 640 X 640 (Instagram size) , will also be removed over next few updates.
- me_bx 11y agoCongrats! Looks beautiful, makes the whole process so easy. This will save so much time to many people.
- pmontra 11y agoGreat demo. Out of curiosity, why not compiling the C algorithm with emcc into asm.js and probably get better performances (but a much larger js file) ?
- secondtimeuse 11y agoIts actually based on https://github.com/kyamagu/js-segment-annotator https://github.com/kyamagu/js-segment-annotator which implements two algorithm SLIC and PF. Regarding compiling C using emscripten, I wanted a pure JS implementation so that it was hackable using Chrome Developer tools, E.g. using LAB data internally produced by SLIC algorithm. Hopefully in future, I will use a emscripten implementation. It might be important for version that proceses short gifs or videos. Also there is a developer mode on top right, enabling it allows visualization of superpixels and change parameters of the algorithm.
- MichaelApproved 11y agoIt was hard to get an idea of the final result in the demo gif because the last frame disappeared so quickly. Here it is http://imgur.com/fduYXCi http://imgur.com/fduYXCi
- secondtimeuse 11y agoThanks, I added it to the readme.
- MichaelApproved 11y agoIn the readme file, you have "License: Copyright 2015, Cornell University. All Rights Reserved." Does that mean there isn't a public license to use it?
- secondtimeuse 11y agoIt will be released under Open Source compatible license, I just need to make sure since I am a PhD student. Note that the underlying algorithm implementations are MIT licensed. https://github.com/kyamagu/js-segment-annotator/blob/master/LICENSE https://github.com/kyamagu/js-segment-annotator/blob/master/...
- eonw 11y agoi tried to use it, it just crashed FireFox 39.0 on Windows 7.
- dharma1 11y agoGreat stuff. Anyone aware of Android libs for this?
- secondtimeuse 11y agoOpenCV has GrabCut implementation which works on android. There are numerous implementations of SLIC superpixels. Even this will work through a cordova style wrapper, but I would really not recommend it, since you can use a much faster and accurate native OpenCV on android.
- pg_is_a_butt 11y agotried it... it sucked. splotchy as fuck.
- skstronghold 11y agoWas working on a similar problem, to fetch color of cloths from images(including models and background) in an e-commerce website. This implementation gives the best result so far.
- secondtimeuse 11y agoDepending on the size of the object you are trying to segment relative to the image, you can adjust the size of superpixels. To segment parts such as clothes you can set large superpixel size by enabling developer option on top right corner. You can also see superpixels rendered to understand which size gives best results. This method can perform even approximate non-interactive segmentation.