Add support for OpenCV 3

This commit is contained in:
Milan Nikolic
2018-03-14 13:45:38 +01:00
parent 8a740337ab
commit 3c0c949f31
6 changed files with 181 additions and 45 deletions

View File

@@ -1,3 +1,5 @@
// +build !cv3
// Package camera.
package camera
@@ -8,49 +10,6 @@ import (
"github.com/lazywei/go-opencv/opencv"
)
// Property identifiers.
const (
PropPosMsec = iota
PropPosFrames
PropPosAviRatio
PropFrameWidth
PropFrameHeight
PropFps
PropFourcc
PropFrameCount
PropFormat
PropMode
PropBrightness
PropContrast
PropSaturation
PropHue
PropGain
PropExposure
PropConvertRgb
PropWhiteBalanceU
PropRectification
PropMonocrome
PropSharpness
PropAutoExposure
PropGamma
PropTemperature
PropTrigger
PropTriggerDelay
PropWhiteBalanceV
PropZoom
PropFocus
PropGuid
PropIsoSpeed
PropMaxDc1394
PropBacklight
PropPan
PropTilt
PropRoll
PropIris
PropSettings
PropBuffersize
)
// Camera represents camera.
type Camera struct {
camera *opencv.Capture
@@ -86,8 +45,8 @@ func (c *Camera) GetProperty(id int) float64 {
}
// SetProperty sets a camera property.
func (c *Camera) SetProperty(id int, value float64) int {
return c.camera.SetProperty(id, value)
func (c *Camera) SetProperty(id int, value float64) {
c.camera.SetProperty(id, value)
}
// Close closes camera.