Cylon.js For OpenCV
Cylon.js (http://cylonjs.com) is a JavaScript framework for robotics, physical computing, and the Internet of Things (IoT).
This repository contains the Cylon adaptor and drivers for OpenCV (http://opencv.org/), the powerful open source computer vision platform. It uses the node-opencv module https://github.com/peterbraden/node-opencv created by @peterbraden thank you!
Want to use Ruby on robots? Check out our sister project Artoo (http://artoo.io)
Want to use the Go programming language to power your robots? Check out our sister project Gobot (http://gobot.io).
How to Install
$ npm install cylon cylon-opencv
In order to use OpenCV you first need to install it and make sure it is working correctly on your computer. You can follow the tutorials in the OpenCV site to install it in your particular OS:
Ubuntu
#!/bin/bash sudo apt-get -y install autoconf automake build-essential git libass-dev libgpac-dev \ libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \ libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev yasm libmp3lame-dev \ libopus-dev libvpx-dev cmake libgtk2.0-dev pkg-config libjpeg8 libjpeg8-dev \ libgstreamer0.10-0 libgstreamer0.10-dev gstreamer0.10-tools gstreamer0.10-plugins-base \ libgstreamer-plugins-base0.10-dev gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly \ gstreamer0.10-plugins-bad gstreamer0.10-ffmpegmkdir ~/ffmpeg_sourcescd ~/ffmpeg_sourcesgit clone --depth 1 git://git.videolan.org/x264.gitcd x264./configure --prefix="/usr/local" --bindir="/usr/local/bin" --enable-shared --enable-picmakesudo make installcd ~/ffmpeg_sourcesgit clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aaccd fdk-aacautoreconf -fiv./configure --prefix="/usr/local" --bindir="/usr/local/bin" --enable-shared --with-picmakesudo make installcd ~/ffmpeg_sourcesgit clone --depth 1 git://source.ffmpeg.org/ffmpegcd ffmpegexport PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"./configure --prefix="/usr/local" --extra-cflags="-I/usr/local/include" --extra-ldflags="-L/usr/local/lib" --bindir="/usr/local/bin" \ --extra-libs="-ldl" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora \ --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab --enable-shared --enable-picmakesudo make installhash -rcd ~git clone --depth 1 -b 2.4.6.2 https://github.com/Itseez/opencv.gitcd opencvmkdir releasecd releasecmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..makesudo make install
Intel Edison
IMPORTANT NOTE: if you are using the latest Edison firmware then DO NOT run opkg install kernel-module-uvcvideo
as the UVC drivers are already installed, and it will cause them to stop working!
Follow instructions from http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html to add the "official unofficial" package repo.
Then run these commands:
opkg install libopencv-core-dev
opkg install libopencv-calib3d-dev
opkg install libopencv-contrib-dev
opkg install libopencv-features2d-dev
opkg install libopencv-flann-dev
opkg install libopencv-gpu-dev
opkg install libopencv-highgui-dev
opkg install libopencv-imgproc-dev
opkg install libopencv-legacy-dev
opkg install libopencv-ml-dev
opkg install libopencv-nonfree-dev
opkg install libopencv-objdetect-dev
opkg install libopencv-ocl-dev
opkg install libopencv-photo-dev
opkg install libopencv-stitching-dev
opkg install libopencv-superres-dev
opkg install libopencv-video-dev
opkg install libopencv-videostab-dev
opkg install opencv-staticdev
How to Use
Using cylon-opencv is pretty easy, same as any other cylon adaptor making use of the appropiate cylon drivers.
The following example shows how to connect to a camera and display the video feed in a window.
Before running it be sure that haarcascade_frontalface_alt.xml
file is referenced to the correct location.
You can download the file here.
var Cylon = ; Cylon; Cylonstart;
How to Connect
In order to use OpenCV you first need to install it and make sure it is working correctly on your computer. You can follow the tutorials in the OpenCV site to install it in your particular OS:
Documentation
We're busy adding documentation to our web site at http://cylonjs.com/ please check there as we continue to work on Cylon.js
Thank you!
Contributing
For our contribution guidelines, please go to https://github.com/hybridgroup/cylon/blob/master/CONTRIBUTING.md .
Release History
For the release history, please go to https://github.com/hybridgroup/cylon-opencv/blob/master/RELEASES.md .
License
Copyright (c) 2013-2015 The Hybrid Group. Licensed under the Apache 2.0 license.