inspirit / jsfeat

JavaScript Computer Vision library.
MIT License
2.74k stars 372 forks source link

NodeJS support? #2

Closed yocontra closed 11 years ago

yocontra commented 11 years ago

Should be as simple as

if (typeof module !== "undefined"){
  module.exports = jsfeat;
}
sandfox commented 11 years ago

Don't forget package.json etc etc...

thalesfsp commented 11 years ago

It's possible to use this library to login (compare registered image with live caption)?

inspirit commented 11 years ago

@thalesfsp library gives a variety of methods/algorithm u can use. how would u use it and what for is another question. there is nothing of this kind possible out of the box :)

hitsthings commented 11 years ago

Hey @Contra and @sandfox - The only hold-out stopping this from being 100% set for Node is the build_pyramid function in jsfeat_bbf.js which uses canvas heavily.

I'm a CV noob, so I didn't feel safe attempting to reimplement this (I'm sure there's a lot of nuance to combining multiple pixels into one). And I really didn't want to rely on node-canvas because it has a bunch of native dependencies/is a pain to setup, and this lib is currently so easy to use.

Just mentioning it in case either of you wants to give a JS implementation a crack (for Node only, since I'd bet the current canvas impl would be faster in the browser).

yocontra commented 11 years ago

With NPM installing node-canvas is seamless in most cases. I think having it available on NPM with a few deps vs. not available at all is better

hitsthings commented 11 years ago

Eh, there are quite a few seams to node-canvas. Anyway, jsfeat is already on NPM, just the build_pyramid function won't work.

Agree node-canvas is better than nothing. I just want something better for devspeed. Would be great if node-canvas were an optional dependency with a JS fallback. Maybe that's step two though.

Cheers.

inspirit commented 11 years ago

i removed canvas dependency in bbf module. u can easily use it without any additions now.

hitsthings commented 11 years ago

Well! That's pretty slick. Thanks a ton!

I just published it to NPM. Any reason you don't seem too keen to own the NPM module? Then you can publish yourself.

inspirit commented 11 years ago

well at the moment i dont use it and dont even have account there :) i will better stick with github now, may be later we get back to subject :) thanx