Can I use OpenCV or a similar library in Javascript?

Is it possible to use OpenCV from Javascript? Is there such an implementation?

Are there any JS libraries that can be used to detect face elements in an image or video?

+49
javascript html5 artificial-intelligence opencv face-detection
Feb 03 2018-12-12T00:
source share
9 answers

I do not think that there is any way to use openCV in JS, except to communicate with the server with openCV on it and execute the processing there.

There is one face detection algorithm in JS that I know of: http://badassjs.com/post/1461943420/face-detection-in-javascript-via-html5-canvas

+12
Feb 03 2018-12-12T00:
source share

OpenCV has never been fully ported to JavaScript, but individual parts and algorithms have:

  • To detect faces and faces (and other parts / objects) you can use js-objectdetect or HAAR.js , which are ports for detecting OpenCV objects based on cascades of Haar functions.

  • The very first network face detection algorithm found in ccv is also worth mentioning. It seems that its classifier is less reliable than the one provided by OpenCV.

  • The headtrackr library used for facetracking may also be of interest since it implements the camshift algorithm also found in OpenCV.

+26
Sep 05 '12 at 3:50
source share

I recommend OpenCVjs . This is the javascript OpenCV library.

+17
Sep 10 '13 at 6:18
source share

I do not know the full implementation of OpenCV in Javascript, however, a large number of algorithms from it are implemented in JSFeat which is the Computer Vision library in Javascript.

I believe that it would be possible to compile OpenCV bits with emscripten, but as far as I know, no one has done this.

+14
Jul 03 '13 at 6:19 06:19
source share

Porting OpenCV to Javascript should be done using asm.js, which can compile C or C ++ to Javascript

Other: OpenCV is ported to its own Chrome client: http://opencv.org/opencv-ported-to-google-chrome-nacl-and-pnacl.html

+12
Jun 18 '14 at 10:28
source share

A great repo for this here: https://github.com/peterbraden/node-opencv It doesn't seem to have the full opencv functionality, but there is face detection and excellent support for image streams coming from sources like ar-drone.

+6
Dec 10 '13 at 3:53 on
source share

It seems very good. http://trackingjs.com/ Take a look.

+5
Jun 08 '15 at 6:58
source share

Regarding your second question, clmtrackr looks very promising. It...

... is a javascript library for fitting facial models to faces in videos or images. This is currently an implementation of limited local models equipped with a regularized average shift, as described in an article by Jason M. Saraghih. clmtrackr tracks the face and displays the coordinate positions of the face model in an array.

Try this example to look at their model.

+2
Feb 25 '14 at 15:54
source share

In addition to those mentioned, there is another repo for "opencvjs"

https://github.com/blittle/opencvjs

It’s not clear which of them (if any) should be canonical

+2
Jan 24 '15 at 2:20
source share



All Articles