hybridgroup.gobot/platforms/opencv
deadprogram c64a0d9481 core: Refactoring to allow 'metal' development using Gobot adaptors/drivers.
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-09-12 21:33:14 +02:00
..
LICENSE misc: update all LICENSE files for current year 2016-08-27 13:12:47 +02:00
README.md Use OpenCV 2.4, as well as switch to main fork of go-opencv 2016-02-19 18:36:33 -08:00
camera_driver.go core: Refactoring to allow 'metal' development using Gobot adaptors/drivers. 2016-09-12 21:33:14 +02:00
camera_driver_test.go core: Refactoring to allow 'metal' development using Gobot adaptors/drivers. 2016-09-12 21:33:14 +02:00
doc.go Fix misspellings 2016-07-13 10:44:47 -06:00
haarcascade_frontalface_alt.xml Add more opencv test coverage 2014-07-23 16:38:46 -07:00
helpers_test.go Use OpenCV 2.4, as well as switch to main fork of go-opencv 2016-02-19 18:36:33 -08:00
lena-256x256.jpg Add more opencv test coverage 2014-07-23 16:38:46 -07:00
utils.go Use OpenCV 2.4, as well as switch to main fork of go-opencv 2016-02-19 18:36:33 -08:00
utils_test.go Refactor to use `gobottest` test helpers 2016-02-22 00:33:58 -05:00
window_driver.go tests: complete move of test interfaces into the test files where they belong 2016-08-27 11:56:01 +02:00
window_driver_test.go tests: complete move of test interfaces into the test files where they belong 2016-08-27 11:56:01 +02:00

README.md

OpenCV

OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.

For more info about OpenCV click here

How to Install

This package requires OpenCV version 2.4 to be installed on your system. Please note that it is not compatible with OpenCV 3.x at this time.

OSX

To install OpenCV on OSX using Homebrew:

$ brew tap homebrew/science && brew install opencv

Ubuntu

To install OpenCV on Ubuntu 14.04:

$ sudo apt-get install libopencv-dev

Or, follow the official OpenCV installation guide

Windows

Follow the official OpenCV installation guide

Now you can install the package with

go get -d -u github.com/hybridgroup/gobot/... && go install github.com/hybridgroup/gobot/platforms/opencv

How to Use

Example using the camera.

package main

import (
	cv "github.com/lazywei/go-opencv/opencv"
	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/opencv"
)

func main() {
	gbot := gobot.NewGobot()

	window := opencv.NewWindowDriver("window")
	camera := opencv.NewCameraDriver("camera", 0)

	work := func() {
		gobot.On(camera.Event("frame"), func(data interface{}) {
			window.ShowImage(data.(*cv.IplImage))
		})
	}

	robot := gobot.NewRobot("cameraBot",
		[]gobot.Device{window, camera},
		work,
	)

	gbot.AddRobot(robot)

	gbot.Start()
}