inspirit / jsfeat Goto Github PK
View Code? Open in Web Editor NEWJavaScript Computer Vision library.
License: MIT License
JavaScript Computer Vision library.
License: MIT License
I am amazed by this library. My background is in computer vision and i would like to contribute to this library.
My first project would be something like creating tutorials for creating a cascade with opencv and then detect with it in web with this library.
Any ideas or pointers of anything that could be interesting to look at? (i am skilled in opencv and just need to get my head around the data structure in this library).
Maybe its something you already looked at.
I've been trying to draw the derivative back to the canvas and I can't quite figure out what sort of format it's in, or whether the derivative method takes into account the format of the destination array.
The size of the data returned from the sobel and scharr derivative functions seem to to be a square of the input. Or at least, it's difficult to determine what the output format is.
Any pointers that might help?
Hi!
We are trying to use Haar cascade eye detection classifier with jsfeat on pre-recorded video stream but we are not able to get it. We are currently using two libraries in our application. First one "JSOBJECT DETECT" is being used for face detection and once face is detected we want eye detection process to start working. For eye detection we are using JSFeat library. Can you please guide us how to integrate eye detection in grails application using pre recorded video stream? If you have any example that is already done before that, can you please share with us so that we can use that to solve our issue?
Thanks
Muhammad Ikram Ul Haq
Installing with bower causes an error when we specify the version in bower.json.
Please create a release so that we can install from bower.
Thank you
Should be as simple as
if (typeof module !== "undefined"){
module.exports = jsfeat;
}
I am rather impressed with jsfeat! Have you considered rewriting portions in asm js?
hi, in the two face detection demos (haar and bbf) the video.videoWidth and video.videoHeight are still 0 when demo_app() tries to use those values.
Working solution:
Your lib is awesome btw!
I think it would be useful if the demo site had some examples that use basic video or image files
Possibly if it detailed the entire flow from raw image files (jpg*), through filtering, and into the higher level functions.
Also detailing the return values.
Hi,
First, thanks for this great lib.
When i want to use your examples, IE10 tells me :
"Typed array constructor argument is invalid' at this line :
var data_u32 = new Uint32Array(imageData.data.buffer);
It happends everytime it uses the imageData.data.buffer.
In IE 10, imageData.data.buffer is undefined, in other browsers it's an ArrayBuffer {}
Is there a polyfill, or a solution to this issue ?
I can see you're no longer active on this project so I would like to step in a bit and implement a QR alogirthm using Modified Gram-Schmidt alogithm. Are you wiling to accept my pull request if you happen to like my code?
I am checking on chrome latest version. when i run sample orb it is working fine after some time it is creating Aw! Snap error.. When i check on windows task manager it is utilizing the full memory. Can you help me to solve this.
Hello
i was wondering if it is at all possible to customise the background colour of the canny demo from black to a colour of ones choosing.
https://inspirit.github.io/jsfeat/sample_canny_edge.html
ideally I would want to have a transparent background if possible and maybe the option to change the colours of the line edges to another colour apart from white.
I would appreciate any advice/help that you can give.
Every browser I try says "WebRTC not available" when trying any of the demos
I think there must be a bug somewhere.
I want to carry out shirt color detection using JSFeat. I don't know if it's possible. It can be done in OpenCV using the code here:
http://www.shervinemami.info/shirtDetection.html
I need to know the height of frontal face, in order to bring the rectangle down to make it focus on the t-shirt instead of the face. How can I do that?
Do you guys have any plans to implement Hough Transforms? Or is there another approach to doing line/shape detection (without training data like with haar classifiers) in jsfeat?
Thanks man, really excited to start using this, there's so much stuff in here!
Hello, and thank you for developing this great library.
I am using jsFeat to apply Canny edge detection on an image, but I have trouble showing the image after the edge detector has been applied.
my code looks like this:
var play = document.getElementById('play');
var pause = document.getElementById('pause');
var videoControl = document.getElementById('video');
play.addEventListener('click', function(){
videoControl.play();
})
pause.addEventListener('click', function(){
videoControl.pause();
var canvas2 = document.getElementById("canvas2");
var context = canvas2.getContext('2d');
var data_type = jsfeat.U8_t | jsfeat.C1_t;
var my_matrix = new jsfeat.matrix_t(800, 640, data_type);
jsfeat.imgproc.canny(videoControl, my_matrix, 100, 200);
context.drawImage(my_matrix,0,0,800, 640);
var data = context.getImageData(0,0,800, 640);
// console.log(data);
// console.log(my_matrix);
var img = document.getElementById("image");
img.src = canvas2.toDataURL();
})
The error I get is :
Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)'(anonymous function) @ js.js:21
I understand that my_matrix is not an Image() element, but is there any way to convert it to an acceptable format, so I can drawImage() and show it on a canvas?
Thank you.
Hi, sorry for the issue, i am not understanding how to detect a face in a photo.
This is the code i am using http://pastebin.com/WrphXW1N
Actually it returns the Object with all the infos (confidence, x, y etc..), but how do i check if the data matches a face? Is the confidence value telling me if it's a face or not?
I took this piece of code from the clmtrackr library, which seems to use jsfeat.
Any help appreciated, thank you!
Hi, this is probably not a bug but I wonder if you can help me with this.
Why do I not detect any features in a still image that's in an <img>
tag on my html page?
I basically copied the fast_corners demo. Here's the core code:
http://pastebin.com/Pfx2Hqz9
Tried with the other feature detectors as well. Tried several threshold values down to 1. Tried with several jpg and png images. Checked that the array img_u8
does contain nonzero, nonconstant, data. Tried to do equalize_histogram before detect.
None of it helps. 0 is the output from fast_corners.detect
.
Do you have any idea what I did wrong?
Just wondering how portable across hardware the code in this library is. I was reading this article and came across the problem with the endian problem when doing byte manipulations.
https://hacks.mozilla.org/2011/12/faster-canvas-pixel-manipulation-with-typed-arrays/
Hi, I have created a JS editor which uses FabricJS and JSFeat for interactive computer vision. Currently I have only incorporated two algorithms (Canny and Yape). I have also incorporated two segmentation algorithms, it might be possible to port them to jsfeat.
You can find the demo and source code here
https://jsvisioneditor.appspot.com/
https://github.com/AKSHAYUBHAT/JSVisionEditor
Segmentation algorithms
https://github.com/kyamagu/js-segment-annotator
Canny edge detection demo producing a javascript error and failing to run. Stack trace:
Uncaught ReferenceError: w0 is not defined jsfeat-min.js:1
a.canny jsfeat-min.js:1
tick
Error repeats itself every requestAnimationFrame tick.
Tested in Chrome 26.0.1410.65 stable
I've tried the examples with the latest chrome and firefox on android and they don't work.
What browser/system do I need to try to make them work?
Awesome Library, thanks a lot!
I was just wondering if there are any plans on implementing the TLD (a.k.a. predator) algorithm?
There are several implementations floating around, notably OpenTLD and CCV ( http://libccv.org/doc/doc-tld/)
Since I used your optical flow with great succes, I would love to see jsfeat support tld as well.... Any chance?
Hello, how I can configure jsfeat to get "Gaussian pyramid down"?
Gaussian pyramid down supported by jsfeat?
jsfeat.imgproc.gaussian_blur(source:matrix_t, dest:matrix_t, kernel_size, sigma = 0);
jsfeat.imgproc.pyrdown(source:matrix_t, dest:matrix_t);
=-=-=-=-=-=-=-=
void org.opencv.imgproc.Imgproc.pyrDown(Mat src, Mat dst)
Blurs an image and downsamples it.
The function performs the downsampling step of the Gaussian pyramid construction. First, it convolves the source image with the kernel:
1/256 1 4 6 4 1 4 16 24 16 4 6 24 36 24 6 4 16 24 16 4 1 4 6 4 1
Then, it downsamples the image by rejecting even rows and columns.
=-=-=-=-=-=-=-=
int BLUR_LEVEL = 4;
for (int i = 0; i < BLUR_LEVEL; i++) {
Imgproc.pyrDown(blurred, blurred);
}
=-=-=-=-=-=-=-=
but better will be for jsfeat:
jsfeat.imgproc.pyrdown(source:matrix_t, dest:matrix_t, level);
Hi..
Any ideas how I can show the edges on the original image - say in RED.
after I run
jsfeat.imgproc.canny(img_u8, img_u8, options.low_threshold | 0, options.high_threshold | 0);
thx in advance!
Hello!
Thank for sharing your lib.
I wanted to try the two demos below:
http://inspirit.github.io/jsfeat/sample_haar_face.html
http://inspirit.github.io/jsfeat/sample_bbf_face.html
But they don't work on my Mac (Chrome and Firefox).
Uncaught IndexSizeError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.
Any idea?
Thanks in advance.
Jay
Just curious whether you've considered using web workers to offload detection to another process and if so, where do you stand on that :)
Also, are you going to add canny pruning to the viola jones object detection?
The qsort algo in jsfeat.Math looks pretty similar to an introsort, but I haven't dived into it.
I was just wondering if it actually performs better than the JS built in Array#sort() method.
Maybe I'll fork and see if I can benchmark it
It would be really cool if we could implement BRISK in javascript. http://www.robots.ox.ac.uk/~vgg/rg/papers/brisk.pdf
Your library already has a FAST implementation which could be extended as described in the paper linked to above, to estimate the scale of features.
Having a local feature descriptor would be a great addition to jsfeat.
how detect eyes?
Please add DFT, IDFT, FFT, IFFT support.
Discrete Fourier Transform - needed
Fast Fourier Transform - very needed
Inverted Discrete Fourier Transform
Inverted Fast Fourier Transform
sample is DSP.js - but this not work with matrix(
Hey inspirit, awesome library. Any chance we could get a dense optical flow algorithm? I'm kinda hacking it right now by placing sparse points on a regular grid in my image, but of course it has its drawbacks. I poked around a bit and found https://github.com/anvaka/oflow/blob/master/dist/oflow.js which looks like it already has an implementation? Thanks!
Using latest chrome or FF, i cannot run any demo from http://inspirit.github.com/jsfeat.
I see warp perspective is implemented only for grayscale images.
Is it hard to implement the same for standard color images?
Want to hear your opinion before digging into Java JAI or OpenCV code.
What was the reason why you implemented it for single channel source only?
I was trying to check example with gray scale sampling. But it doesn't work in my browser.
In firefox there is blue screen (in browser). In chrome I got message:
WebRTC not available.
I'm on Ubuntu linux
Could you put some working example? I have seen sample_grayscale.html, downloaded all files to local and it just does not work. Why?
I'm interested in contributing some additional cascades for the BBF detection. Where did you get your face cascades from? I see there's some data sets in libccv
I'm currently using jsfeat in the backend of my project with nodejs.
This is working great except for the loading of the cascades modules.
Could these modules also be made compatible, like jsfeat.js, with nodejs? (with module.exports)
Hi, does this library support opencv FaceRecognizer? Appreciate
Firstly, thank you for this fantastic library, we have just started using it and it's very impressive!
We would like to run face detection on the feed coming from the user's camera but display a preview to the user generated from the canny edge detector. I see you have a use_canny option in your HAAR object detector demo but if I understand it correctly, it is doing the opposite of what we want and feeding the canny edges to the HAAR classifier and showing the original as the preview.
We tried running both the canny edge demo and the HAAR detector demo at the same time on the same page but the performance was terrible.
Do you have a recommendation for a good approach to displaying a canny preview to the user but doing face detection on the original video? Is there a way to pipeline these processes in an efficient way or should we be looking to run canny edges and face detection in parallel with web workers? From our initial experiments, it looks like the BBF face detection is more stable then HAAR so it would be good to try both in conjunction with canny.
Thanks for any advice you can give.
Hello, I am trying to convert an jpg image from color to gray-scale using jsfeat, but all of the color is coming out to black. The following is the code I use.
var image_data=ctx.getImageData(0,0,default_width,default_height);
var image_data_proc= copyImageData(ctx,image_data);
var gray_img=new jsfeat.matrix_t(default_width,default_height,jsfeat.U8_t|jsfeat.C1_t);
jsfeat.imgproc.grayscale(image_data.data,gray_img.data);
var data_u32 = new Uint32Array(image_data.data);
var alpha = (0xff << 24);
var i = gray_img.cols*gray_img.rows, pix = 0;
while(--i >= 0) {
pix =gray_img.data[i];
data_u32[i] = alpha | (pix << 16) | (pix << 8) | pix;
}
ctxImProc.putImageData(image_data,0,0);
Does the library currently only support image from webcam ?
Or is this the "support for RGB/BGR order" that needs to be added ?
Thank you.
my name is dwi nuryani rahmayanti and want to know about JSfeat more. actually i have a small project from my lecturer about implementing coin recognition using web application. can i use some library from JSFeat and implemented it in my case ? if yes, what library function that i should use in order to do that ? thanks for your attention before.
Thanks for this library.
Recently I noticed that in the HAAR (face) detection demo, the video freezes while running in Chrome. The FPS and HAAR detector times keep running (~50 fps, 16 ms), but the video appears frozen, typically within seconds. The BBF demo video freezes as well for me, although I haven't had much prior experience with that. The HAAR detection used to work fine for me months ago. Other demos (sobel, Fast Corners, YAPE included) run fine.
I have a version of jsfeat on my local machine that's at least months old, and worked fine, but now it also freezes. So my guess is the issue is with my browser or computer settings. My Chrome says it's up to date at 39.0.2171.95 m, though perhaps I should try a previous version.
Another odd behavior. If I change browser tabs, then change back, the video works again briefly before freezing again.
Thanks for the awesome library .
Can you please add an example on how to use the handfist.js
PhantomJS, often use for headless browser testing does not support Float64Array. Currently that makes jsfeat fail right away, as the type is used in construction of the data_t class.
However, it looks like major parts of jsfeat works without Float64Array, so it would be good if this was made optional.
Demo pages do not work on Chrome >23 on Windows 8, read "WebRTC not available".
I can't figure out how to include my own classifiers. I have made a XML file with haartraining(sources say that jsfeat needs classifier in "old" format) and converted it to js with haartojs script. It doesn't work when I include it. Which utility should I use for creating the right js files?
I am new to Computer Vision.
Could you share some code like how to detect hand open & hand fist, hand move close & far to webcam.
Or Could you recommend some books or websites about how to use these technology to implement above application ?
how can i set it ??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.