hybridgroup.gobot/platforms/opencv
deadprogram 5f40f44269 opencv: read the image frames as fast as possible
Signed-off-by: deadprogram <ron@hybridgroup.com>
2017-10-05 17:20:42 +02:00
..
LICENSE license: update license year to include 2017 2017-01-02 22:25:17 +01:00
README.md opencv: Switchover to use GoCV and OpenCV 3.3 2017-10-05 17:05:10 +02:00
camera_driver.go opencv: read the image frames as fast as possible 2017-10-05 17:20:42 +02:00
camera_driver_test.go opencv: increase test coverage 2017-04-06 11:01:57 +02:00
doc.go docs: correct OpenCV README link 2016-12-21 10:54:15 +01:00
haarcascade_frontalface_alt.xml Add more opencv test coverage 2014-07-23 16:38:46 -07:00
helpers_test.go opencv: Switchover to use GoCV and OpenCV 3.3 2017-10-05 17:05:10 +02:00
lena-256x256.jpg Add more opencv test coverage 2014-07-23 16:38:46 -07:00
utils.go opencv: Switchover to use GoCV and OpenCV 3.3 2017-10-05 17:05:10 +02:00
utils_test.go opencv: Switchover to use GoCV and OpenCV 3.3 2017-10-05 17:05:10 +02:00
window_driver.go opencv: Switchover to use GoCV and OpenCV 3.3 2017-10-05 17:05:10 +02:00
window_driver_test.go opencv: Switchover to use GoCV and OpenCV 3.3 2017-10-05 17:05:10 +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 3.3 to be installed on your system.

OSX

To install OpenCV on OSX using Homebrew:

$ 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 gobot.io/x/gobot/...

How to Use

Example using the camera.

package main

import (
	"github.com/hybridgroup/gocv"
	"gobot.io/x/gobot"
	"gobot.io/x/gobot/platforms/opencv"
)

func main() {
	window := opencv.NewWindowDriver()
	camera := opencv.NewCameraDriver(0)

	work := func() {
		camera.On(opencv.Frame, func(data interface{}) {
			img := data.(gocv.Mat)
			window.ShowImage(img)
			window.WaitKey(1)
		})
	}

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

	robot.Start()
}