Can we use OpenCV from Javascript? Is there such implementation?
Is there any JS libraries that can be used for detecting face elements in the picture or video?
Can we use OpenCV from Javascript? Is there such implementation?
Is there any JS libraries that can be used for detecting face elements in the picture or video?
OpenCV has never been ported to JavaScript in its entirety, but individual parts and algorithms have:
For face and face element detection (and other parts / objects), you could use js-objectdetect or HAAR.js which are ports of the OpenCV Object Detection based on Haar Feature Cascades.
The very first face detection algorithm on the web found in ccv also deserves a mention. Its classifier seems to be less reliable than the one provided by OpenCV though.
The headtrackr library used for facetracking might also be of interest since it implements the camshift algorithm also found in OpenCV.
I don't think there is any way of using openCV in JS other than communicating with a server with openCV on it and doing the processing there.
There is one Face detection algo in JS that I know of: http://badassjs.com/post/1461943420/face-detection-in-javascript-via-html5-canvas
I do not know of a full implementation of OpenCV in Javascript, however a good number of the algorithms from it are implemented in JSFeat which is a Computer Vision library in Javascript.
I believe that it might be possible to compile bits of OpenCV with emscripten, but as far as I know, nobody has done that.
Porting OpenCV to Javascript should be doable using asm.js which can compile C or C++ to Javascript
Another take: OpenCV is ported to Chrome Native Client: http://opencv.org/opencv-ported-to-google-chrome-nacl-and-pnacl.html
Excellent repo for that here: https://github.com/peterbraden/node-opencv Doesn't seem to have full opencv functionality, but has face detection and great support for image streams coming from sources like an ar-drone.
Concerning your second question clmtrackr looks very promising. It ...
... is a javascript library for fitting facial models to faces in videos or images. It currently is an implementation of constrained local models fitted by regularized landmark mean-shift, as described in Jason M. Saragih's paper. clmtrackr tracks a face and outputs the coordinate positions of the face model as an array.
Try out this example to have a look at their model.
In addition to those mentioned, there is another repo for "opencvjs"
https://github.com/blittle/opencvjs
It's a little unclear which of them (if any) are supposed to be canonical