Documentation ¶
Overview ¶
Package opencv provides Go bindings for OpenCV 1.1.
Install `GCC` or `MinGW` (http://tdm-gcc.tdragon.net/download) at first, and then run these commands:
- `go get -d github.com/chai2010/opencv`
- `go generate` and `go install`
- `go run hello.go`
Example:
// Copyright 2014 <chaishushan{AT}gmail.com>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "fmt" "log" "os" "github.com/chai2010/opencv" ) func main() { filename := "../images/lena.jpg" if len(os.Args) == 2 { filename = os.Args[1] } image := opencv.LoadImage(filename) if image == nil { log.Fatalf("LoadImage %s failed!", filename) } defer image.Release() win := opencv.NewWindow("Go-OpenCV") defer win.Destroy() win.SetMouseCallback(func(event, x, y, flags int) { fmt.Printf("event = %d, x = %d, y = %d, flags = %d\n", event, x, y, flags, ) }) win.CreateTrackbar("Thresh", 1, 100, func(pos int) { fmt.Printf("pos = %d\n", pos) }) win.ShowImage(image) opencv.WaitKey(0) }
Report bugs to <chaishushan@gmail.com>.
Thanks!
Example (Version) ¶
package main import ( "fmt" opencv "github.com/chai2010/opencv" ) func main() { fmt.Printf("OpenCV %v\n", opencv.CV_VERSION) }
Output: OpenCV 1.1.0
Index ¶
- Constants
- Variables
- func Alloc(size int) unsafe.Pointer
- func CV_ARE_TYPE_EQ() bool
- func CV_HIST_HAS_RANGES() bool
- func CV_IS_HIST() bool
- func CV_IS_IMAGE(img unsafe.Pointer) bool
- func CV_IS_IMAGE_HDR(img unsafe.Pointer) bool
- func CV_IS_MASK_ARR() bool
- func CV_IS_MAT(mat interface{}) bool
- func CV_IS_MAT_HDR(mat interface{}) bool
- func CV_IS_SPARSE_HIST() bool
- func CV_IS_UNIFORM_HIST() bool
- func Canny(image, edges *IplImage, threshold1, threshold2 float64, aperture_size int)
- func Ceil(value float64) int
- func ConvertImage(src, dst unsafe.Pointer, flags int)
- func Copy(src, dst, mask *IplImage)
- func CvToIplDepth(_type int) int
- func CvtColor(src, dst *IplImage, code int)
- func DecRefData(arr *CvArr)
- func DestroyAllWindows()
- func FOURCC(c1, c2, c3, c4 int8) int32
- func Floor(value float64) int
- func Free(p unsafe.Pointer)
- func GetSizeHeight(img *IplImage) int
- func GetSizeWidth(img *IplImage) int
- func IncRefData(arr *CvArr)
- func Inpaint(src, inpaint_mask, dst *IplImage, inpaintRange float64, flags int)
- func IsInf(value float64) int
- func IsNaN(value float64) int
- func Line(image *IplImage, pt1, pt2 Point, color Scalar, thickness, line_type, shift int)
- func Not(src, dst *IplImage)
- func RawDataToScalar(data unsafe.Pointer, type_ int, scalar *Scalar)
- func Round(value float64) int
- func SaveImage(filename string, image *IplImage) int
- func ScalarToRawData(scalar *Scalar, data unsafe.Pointer, type_, extend_to_12 int)
- func Smooth(src, dst *IplImage, smoothtype, param1, param2 int, param3, param4 float64)
- func StartWindowThread() int
- func WaitKey(delay int) int
- func Zero(img *IplImage)
- type Box2D
- type CVStatus
- type Capture
- func (capture *Capture) GetProperty(property_id int) float64
- func (capture *Capture) GrabFrame() bool
- func (capture *Capture) QueryFrame() *IplImage
- func (capture *Capture) Release()
- func (capture *Capture) RetrieveFrame() *IplImage
- func (capture *Capture) SetProperty(property_id int, value float64) int
- type Cv32suf
- type Cv64suf
- type CvArr
- type CvAttrList
- type CvAvgComp
- type CvChain
- type CvChainPtReader
- type CvConDensation
- type CvConnectedComp
- type CvContour
- type CvContourScanner
- type CvContourTree
- type CvConvexityDefect
- type CvFileStorage
- type CvFilter
- type CvGraph
- type CvGraphEdge
- type CvGraphVtx
- type CvGraphVtx2D
- type CvHaarClassifierCascade
- type CvHaarFeature
- type CvHaarStageClassifier
- type CvHuMoments
- type CvKalman
- type CvMemBlock
- type CvMemStorage
- type CvMemStoragePos
- type CvMoments
- type CvNextEdgeType
- type CvQuadEdge2D
- type CvSeq
- type CvSeqBlock
- type CvSeqReader
- type CvSeqWriter
- type CvSet
- type CvSubdiv2D
- type CvSubdiv2DEdge
- type CvSubdiv2DPoint
- type CvSubdiv2DPointLocation
- type HistType
- type Histogram
- type IplConvKernel
- type IplConvKernelFP
- type IplImage
- func (p *IplImage) At(x, y int) color.Color
- func (p *IplImage) Bounds() image.Rectangle
- func (img *IplImage) Clone() *IplImage
- func (p *IplImage) ColorModel() color.Model
- func (img *IplImage) GetCOI() int
- func (p *IplImage) GetChannels() int
- func (p *IplImage) GetDepth() int
- func (p *IplImage) GetHeight() int
- func (p *IplImage) GetImageData() []byte
- func (p *IplImage) GetImageSize() int
- func (p *IplImage) GetOrigin() int
- func (img *IplImage) GetROI() Rect
- func (p *IplImage) GetWidth() int
- func (p *IplImage) GetWidthStep() int
- func (img *IplImage) InitHeader(w, h, depth, channels, origin, align int)
- func (p *IplImage) PixOffset(x, y int) int
- func (img *IplImage) Release()
- func (img *IplImage) ReleaseHeader()
- func (img *IplImage) ResetROI()
- func (img *IplImage) SetCOI(coi int)
- func (img *IplImage) SetROI(rect Rect)
- type IplROI
- type LineIterator
- type Mat
- func CreateMat(rows, cols, type_ int) *Mat
- func CreateMatHeader(rows, cols, type_ int) *Mat
- func GetCol(arr *CvArr, submat *Mat, col int) *Mat
- func GetCols(arr *CvArr, submat *Mat, start_col, end_col int) *Mat
- func GetDiag(arr *CvArr, submat *Mat, diag int) *Mat
- func GetRow(arr *CvArr, submat *Mat, row int) *Mat
- func GetRows(arr *CvArr, submat *Mat, start_row, end_row, delta_row int) *Mat
- func GetSubRect(arr *CvArr, submat *Mat, rect Rect) *Mat
- func LoadImageM(filename string, iscolor int) *Mat
- func (mat *Mat) Clone() *Mat
- func (mat *Mat) Cols() int
- func (m *Mat) Get(row, col int) float64
- func (m *Mat) Init(rows, cols int, _type int, data unsafe.Pointer)
- func (mat *Mat) InitHeader(rows, cols, type_ int, data unsafe.Pointer, step int)
- func (mat *Mat) Release()
- func (mat *Mat) Rows() int
- func (m *Mat) Set(row, col int, value float64)
- func (mat *Mat) Step() int
- func (mat *Mat) Type() int
- type MatND
- type MouseFunc
- type MouseFuncA
- type MouseFuncB
- type Point
- type Point2D32f
- type Point2D64f
- type Point3D32f
- type Point3D64f
- type RNG
- type Rect
- type Scalar
- type Size
- type Size2D32f
- type Slice
- type SparseMat
- type SparseMatIterator
- type SparseNode
- type TermCriteria
- type TrackbarFunc
- type TrackbarFuncA
- type TrackbarFuncB
- type VideoWriter
- type Window
- func (win *Window) CreateTrackbar(name string, value, count int, on_changed TrackbarFunc, param ...interface{}) bool
- func (win *Window) Destroy()
- func (win *Window) GetHandle() unsafe.Pointer
- func (win *Window) GetTrackbarPos(name string) (value, max int)
- func (win *Window) GetWindowName() string
- func (win *Window) Move(x, y int)
- func (win *Window) Resize(width, height int)
- func (win *Window) SetMouseCallback(on_mouse MouseFunc, param ...interface{})
- func (win *Window) SetTrackbarPos(name string, pos int)
- func (win *Window) ShowImage(image *IplImage)
Examples ¶
Constants ¶
const ( CV_BGR2GRAY = C.CV_BGR2GRAY CV_BLUR = C.CV_BLUR )
const ( CV_INPAINT_NS = C.CV_INPAINT_NS CV_INPAINT_TELEA = C.CV_INPAINT_TELEA )
const ( CV_DIST_USER = C.CV_DIST_USER CV_DIST_L1 = C.CV_DIST_L1 CV_DIST_L2 = C.CV_DIST_L2 CV_DIST_C = C.CV_DIST_C CV_DIST_L12 = C.CV_DIST_L12 CV_DIST_FAIR = C.CV_DIST_FAIR CV_DIST_WELSCH = C.CV_DIST_WELSCH CV_DIST_HUBER = C.CV_DIST_HUBER )
const ( CV_MAJOR_VERSION = 1 CV_MINOR_VERSION = 1 CV_SUBMINOR_VERSION = 0 CV_VERSION = "1.1.0" )
const ( CV_PI = 3.1415926535897932384626433832795 CV_LOG2 = 0.69314718055994530941723212145818 )
const ( IPL_DEPTH_SIGN = C.IPL_DEPTH_SIGN IPL_DEPTH_1U = C.IPL_DEPTH_1U IPL_DEPTH_8U = C.IPL_DEPTH_8U IPL_DEPTH_16U = C.IPL_DEPTH_16U IPL_DEPTH_32F = C.IPL_DEPTH_32F IPL_DEPTH_8S = C.IPL_DEPTH_8S IPL_DEPTH_16S = C.IPL_DEPTH_16S IPL_DEPTH_32S = C.IPL_DEPTH_32S IPL_DATA_ORDER_PIXEL = C.IPL_DATA_ORDER_PIXEL IPL_DATA_ORDER_PLANE = C.IPL_DATA_ORDER_PLANE IPL_ORIGIN_TL = C.IPL_ORIGIN_TL IPL_ORIGIN_BL = C.IPL_ORIGIN_BL IPL_ALIGN_4BYTES = C.IPL_ALIGN_4BYTES IPL_ALIGN_8BYTES = C.IPL_ALIGN_8BYTES IPL_ALIGN_16BYTES = C.IPL_ALIGN_16BYTES IPL_ALIGN_32BYTES = C.IPL_ALIGN_32BYTES IPL_ALIGN_DWORD = C.IPL_ALIGN_DWORD IPL_ALIGN_QWORD = C.IPL_ALIGN_QWORD IPL_BORDER_CONSTANT = C.IPL_BORDER_CONSTANT IPL_BORDER_REPLICATE = C.IPL_BORDER_REPLICATE IPL_BORDER_REFLECT = C.IPL_BORDER_REFLECT IPL_BORDER_WRAP = C.IPL_BORDER_WRAP )
const ( IPL_IMAGE_HEADER = C.IPL_IMAGE_HEADER // 1 IPL_IMAGE_DATA = C.IPL_IMAGE_DATA // 2 IPL_IMAGE_ROI = C.IPL_IMAGE_ROI // 4 )
const ( CV_MATND_MAGIC_VAL = C.CV_MATND_MAGIC_VAL CV_TYPE_NAME_MATND = C.CV_TYPE_NAME_MATND CV_MAX_DIM = C.CV_MAX_DIM CV_MAX_DIM_HEAP = C.CV_MAX_DIM_HEAP )
const ( CV_SPARSE_MAT_MAGIC_VAL = C.CV_SPARSE_MAT_MAGIC_VAL CV_TYPE_NAME_SPARSE_MAT = C.CV_TYPE_NAME_SPARSE_MAT )
const ( CV_HIST_MAGIC_VAL = C.CV_HIST_MAGIC_VAL CV_HIST_UNIFORM_FLAG = C.CV_HIST_UNIFORM_FLAG /* indicates whether bin ranges are set already or not */ CV_HIST_RANGES_FLAG = C.CV_HIST_RANGES_FLAG CV_HIST_ARRAY = C.CV_HIST_ARRAY CV_HIST_SPARSE = C.CV_HIST_SPARSE CV_HIST_TREE = C.CV_HIST_TREE /* should be used as a parameter only, it turns to CV_HIST_UNIFORM_FLAG of hist->type */ CV_HIST_UNIFORM = C.CV_HIST_UNIFORM )
const ( CV_TERMCRIT_ITER = C.CV_TERMCRIT_ITER CV_TERMCRIT_NUMBER = C.CV_TERMCRIT_NUMBER CV_TERMCRIT_EPS = C.CV_TERMCRIT_EPS )
const ( CV_STORAGE_READ = C.CV_STORAGE_READ CV_STORAGE_WRITE = C.CV_STORAGE_WRITE CV_STORAGE_WRITE_TEXT = C.CV_STORAGE_WRITE_TEXT CV_STORAGE_WRITE_BINARY = C.CV_STORAGE_WRITE_BINARY CV_STORAGE_APPEND = C.CV_STORAGE_APPEND )
Storage flags:
const ( CV_StsOk = CVStatus(C.CV_StsOk) /* everithing is ok */ CV_StsBackTrace = CVStatus(C.CV_StsBackTrace) /* pseudo error for back trace */ CV_StsError = CVStatus(C.CV_StsError) /* unknown /unspecified error */ CV_StsInternal = CVStatus(C.CV_StsInternal) /* internal error (bad state) */ CV_StsNoMem = CVStatus(C.CV_StsNoMem) /* insufficient memory */ CV_StsBadArg = CVStatus(C.CV_StsBadArg) /* function arg/param is bad */ CV_StsBadFunc = CVStatus(C.CV_StsBadFunc) /* unsupported function */ CV_StsNoConv = CVStatus(C.CV_StsNoConv) /* iter. didn't converge */ CV_StsAutoTrace = CVStatus(C.CV_StsAutoTrace) /* tracing */ CV_HeaderIsNull = CVStatus(C.CV_HeaderIsNull) /* image header is NULL */ CV_BadImageSize = CVStatus(C.CV_BadImageSize) /* image size is invalid */ CV_BadOffset = CVStatus(C.CV_BadOffset) /* offset is invalid */ CV_BadDataPtr = CVStatus(C.CV_BadDataPtr) /**/ CV_BadStep = CVStatus(C.CV_BadStep) /**/ CV_BadModelOrChSeq = CVStatus(C.CV_BadModelOrChSeq) /**/ CV_BadNumChannels = CVStatus(C.CV_BadNumChannels) /**/ CV_BadNumChannel1U = CVStatus(C.CV_BadNumChannel1U) /**/ CV_BadDepth = CVStatus(C.CV_BadDepth) /**/ CV_BadAlphaChannel = CVStatus(C.CV_BadAlphaChannel) /**/ CV_BadOrder = CVStatus(C.CV_BadOrder) /**/ CV_BadOrigin = CVStatus(C.CV_BadOrigin) /**/ CV_BadAlign = CVStatus(C.CV_BadAlign) /**/ CV_BadCallBack = CVStatus(C.CV_BadCallBack) /**/ CV_BadTileSize = CVStatus(C.CV_BadTileSize) /**/ CV_BadCOI = CVStatus(C.CV_BadCOI) /**/ CV_BadROISize = CVStatus(C.CV_BadROISize) /**/ CV_MaskIsTiled = CVStatus(C.CV_MaskIsTiled) /**/ CV_StsNullPtr = CVStatus(C.CV_StsNullPtr) /* null pointer */ CV_StsVecLengthErr = CVStatus(C.CV_StsVecLengthErr) /* incorrect vector length */ CV_StsFilterStructContentErr = CVStatus(C.CV_StsFilterStructContentErr) /* incorr. filter structure content */ CV_StsKernelStructContentErr = CVStatus(C.CV_StsKernelStructContentErr) /* incorr. transform kernel content */ CV_StsFilterOffsetErr = CVStatus(C.CV_StsFilterOffsetErr) /* incorrect filter ofset value */ CV_StsBadSize = CVStatus(C.CV_StsBadSize) /* the input/output structure size is incorrect */ CV_StsDivByZero = CVStatus(C.CV_StsDivByZero) /* division by zero */ CV_StsInplaceNotSupported = CVStatus(C.CV_StsInplaceNotSupported) /* in-place operation is not supported */ CV_StsObjectNotFound = CVStatus(C.CV_StsObjectNotFound) /* request can't be completed */ CV_StsUnmatchedFormats = CVStatus(C.CV_StsUnmatchedFormats) /* formats of input/output arrays differ */ CV_StsBadFlag = CVStatus(C.CV_StsBadFlag) /* flag is wrong or not supported */ CV_StsBadPoint = CVStatus(C.CV_StsBadPoint) /* bad CvPoint */ CV_StsBadMask = CVStatus(C.CV_StsBadMask) /* bad format of mask (neither 8uC1 nor 8sC1)*/ CV_StsUnmatchedSizes = CVStatus(C.CV_StsUnmatchedSizes) /* sizes of input/output structures do not match */ CV_StsUnsupportedFormat = CVStatus(C.CV_StsUnsupportedFormat) /* the data format/type is not supported by the function*/ CV_StsOutOfRange = CVStatus(C.CV_StsOutOfRange) /* some of parameters are out of range */ CV_StsParseError = CVStatus(C.CV_StsParseError) /* invalid syntax/structure of the parsed file */ CV_StsNotImplemented = CVStatus(C.CV_StsNotImplemented) /* the requested function/feature is not implemented */ CV_StsBadMemBlock = CVStatus(C.CV_StsBadMemBlock) /* an allocated block has been corrupted */ )
const ( CV_EVENT_MOUSEMOVE = int(C.CV_EVENT_MOUSEMOVE) CV_EVENT_LBUTTONDOWN = int(C.CV_EVENT_LBUTTONDOWN) CV_EVENT_RBUTTONDOWN = int(C.CV_EVENT_RBUTTONDOWN) CV_EVENT_MBUTTONDOWN = int(C.CV_EVENT_MBUTTONDOWN) CV_EVENT_LBUTTONUP = int(C.CV_EVENT_LBUTTONUP) CV_EVENT_RBUTTONUP = int(C.CV_EVENT_RBUTTONUP) CV_EVENT_MBUTTONUP = int(C.CV_EVENT_MBUTTONUP) CV_EVENT_LBUTTONDBLCLK = int(C.CV_EVENT_LBUTTONDBLCLK) CV_EVENT_RBUTTONDBLCLK = int(C.CV_EVENT_RBUTTONDBLCLK) CV_EVENT_MBUTTONDBLCLK = int(C.CV_EVENT_MBUTTONDBLCLK) CV_EVENT_FLAG_LBUTTON = int(C.CV_EVENT_FLAG_LBUTTON) CV_EVENT_FLAG_RBUTTON = int(C.CV_EVENT_FLAG_RBUTTON) CV_EVENT_FLAG_MBUTTON = int(C.CV_EVENT_FLAG_MBUTTON) CV_EVENT_FLAG_CTRLKEY = int(C.CV_EVENT_FLAG_CTRLKEY) CV_EVENT_FLAG_SHIFTKEY = int(C.CV_EVENT_FLAG_SHIFTKEY) CV_EVENT_FLAG_ALTKEY = int(C.CV_EVENT_FLAG_ALTKEY) )
const ( /* 8bit, color or not */ CV_LOAD_IMAGE_UNCHANGED = int(C.CV_LOAD_IMAGE_UNCHANGED) /* 8bit, gray */ CV_LOAD_IMAGE_GRAYSCALE = int(C.CV_LOAD_IMAGE_GRAYSCALE) /* ?, color */ CV_LOAD_IMAGE_COLOR = int(C.CV_LOAD_IMAGE_COLOR) /* any depth, ? */ CV_LOAD_IMAGE_ANYDEPTH = int(C.CV_LOAD_IMAGE_ANYDEPTH) /* ?, any color */ CV_LOAD_IMAGE_ANYCOLOR = int(C.CV_LOAD_IMAGE_ANYCOLOR) )
const ( CV_CVTIMG_FLIP = int(C.CV_CVTIMG_FLIP) CV_CVTIMG_SWAP_RB = int(C.CV_CVTIMG_SWAP_RB) )
const ( CV_CAP_ANY = int(C.CV_CAP_ANY) // autodetect CV_CAP_MIL = int(C.CV_CAP_MIL) // MIL proprietary drivers CV_CAP_VFW = int(C.CV_CAP_VFW) // platform native CV_CAP_V4L = int(C.CV_CAP_V4L) CV_CAP_V4L2 = int(C.CV_CAP_V4L2) CV_CAP_FIREWARE = int(C.CV_CAP_FIREWARE) // IEEE 1394 drivers CV_CAP_FIREWIRE = int(C.CV_CAP_FIREWIRE) CV_CAP_IEEE1394 = int(C.CV_CAP_IEEE1394) CV_CAP_DC1394 = int(C.CV_CAP_DC1394) CV_CAP_CMU1394 = int(C.CV_CAP_CMU1394) CV_CAP_STEREO = int(C.CV_CAP_STEREO) // TYZX proprietary drivers CV_CAP_TYZX = int(C.CV_CAP_TYZX) CV_TYZX_LEFT = int(C.CV_TYZX_LEFT) CV_TYZX_RIGHT = int(C.CV_TYZX_RIGHT) CV_TYZX_COLOR = int(C.CV_TYZX_COLOR) CV_TYZX_Z = int(C.CV_TYZX_Z) CV_CAP_QT = int(C.CV_CAP_QT) // QuickTime CV_CAP_UNICAP = int(C.CV_CAP_UNICAP) // Unicap drivers CV_CAP_DSHOW = int(C.CV_CAP_DSHOW) // DirectShow (via videoInput) )
const ( CV_CAP_PROP_POS_MSEC = int(C.CV_CAP_PROP_POS_MSEC) CV_CAP_PROP_POS_FRAMES = int(C.CV_CAP_PROP_POS_FRAMES) CV_CAP_PROP_POS_AVI_RATIO = int(C.CV_CAP_PROP_POS_AVI_RATIO) CV_CAP_PROP_FRAME_WIDTH = int(C.CV_CAP_PROP_FRAME_WIDTH) CV_CAP_PROP_FRAME_HEIGHT = int(C.CV_CAP_PROP_FRAME_HEIGHT) CV_CAP_PROP_FPS = int(C.CV_CAP_PROP_FPS) CV_CAP_PROP_FOURCC = int(C.CV_CAP_PROP_FOURCC) CV_CAP_PROP_FRAME_COUNT = int(C.CV_CAP_PROP_FRAME_COUNT) CV_CAP_PROP_FORMAT = int(C.CV_CAP_PROP_FORMAT) CV_CAP_PROP_MODE = int(C.CV_CAP_PROP_MODE) CV_CAP_PROP_BRIGHTNESS = int(C.CV_CAP_PROP_BRIGHTNESS) CV_CAP_PROP_CONTRAST = int(C.CV_CAP_PROP_CONTRAST) CV_CAP_PROP_SATURATION = int(C.CV_CAP_PROP_SATURATION) CV_CAP_PROP_HUE = int(C.CV_CAP_PROP_HUE) CV_CAP_PROP_GAIN = int(C.CV_CAP_PROP_GAIN) CV_CAP_PROP_EXPOSURE = int(C.CV_CAP_PROP_EXPOSURE) CV_CAP_PROP_CONVERT_RGB = int(C.CV_CAP_PROP_CONVERT_RGB) // CV_CAP_PROP_WHITE_BALANCE = int(C.CV_CAP_PROP_WHITE_BALANCE) CV_CAP_PROP_RECTIFICATION = int(C.CV_CAP_PROP_RECTIFICATION) )
const (
CV_AUTOSTEP = C.CV_AUTOSTEP
)
mat step
const ( /* Open Codec Selection Dialog (Windows only) */ CV_FOURCC_PROMPT = int(C.CV_FOURCC_PROMPT) )
const CV_GAUSSIAN_5x5 = C.CV_GAUSSIAN_5x5
const (
CV_WHOLE_SEQ_END_INDEX = C.CV_WHOLE_SEQ_END_INDEX
)
const (
CV_WINDOW_AUTOSIZE = C.CV_WINDOW_AUTOSIZE
)
const (
IPL_DEPTH_64F = C.IPL_DEPTH_64F
)
Variables ¶
var ( IPL_IMAGE_MAGIC_VAL = C.IPL_IMAGE_MAGIC_VAL CV_TYPE_NAME_IMAGE = C.CV_TYPE_NAME_IMAGE )
Functions ¶
func CV_ARE_TYPE_EQ ¶
func CV_ARE_TYPE_EQ() bool
func CV_HIST_HAS_RANGES ¶
func CV_HIST_HAS_RANGES() bool
func CV_IS_HIST ¶
func CV_IS_HIST() bool
func CV_IS_IMAGE ¶
func CV_IS_IMAGE_HDR ¶
func CV_IS_MASK_ARR ¶
func CV_IS_MASK_ARR() bool
func CV_IS_MAT_HDR ¶
func CV_IS_MAT_HDR(mat interface{}) bool
func CV_IS_SPARSE_HIST ¶
func CV_IS_SPARSE_HIST() bool
func CV_IS_UNIFORM_HIST ¶
func CV_IS_UNIFORM_HIST() bool
func ConvertImage ¶
utility function: convert one image to another with optional vertical flip
func CvToIplDepth ¶
func DecRefData ¶
func DecRefData(arr *CvArr)
Decrements CvMat data reference counter and deallocates the data if
it reaches 0
func DestroyAllWindows ¶
func DestroyAllWindows()
destroy window and all the trackers associated with it
func FOURCC ¶
Prototype for CV_FOURCC so that swig can generate wrapper without mixing up the define
func GetSizeHeight ¶
func GetSizeWidth ¶
Returns width and height of array in elements
func Line ¶
Draws 4-connected, 8-connected or antialiased line segment connecting two points
color Scalar,
func ScalarToRawData ¶
low-level scalar <-> raw data conversion functions
func StartWindowThread ¶
func StartWindowThread() int
Types ¶
type Capture ¶
"black box" capture structure
func NewCameraCapture ¶
start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*)
func NewFileCapture ¶
start capturing frames from video file
func (*Capture) GetProperty ¶
retrieve or set capture properties
func (*Capture) GrabFrame ¶
grab a frame, return 1 on success, 0 on fail.
this function is thought to be fast
func (*Capture) QueryFrame ¶
Just a combination of cvGrabFrame and cvRetrieveFrame
!!!DO NOT RELEASE or MODIFY the retrieved frame!!!
func (*Capture) Release ¶
func (capture *Capture) Release()
stop capturing/reading and free resources
func (*Capture) RetrieveFrame ¶
get the frame grabbed with cvGrabFrame(..)
This function may apply some frame processing like frame decompression, flipping etc. !!!DO NOT RELEASE or MODIFY the retrieved frame!!!
type CvAttrList ¶
type CvAttrList C.CvAttrList
type CvChainPtReader ¶
type CvChainPtReader C.CvChainPtReader
type CvConDensation ¶
type CvConDensation C.CvConDensation
type CvConnectedComp ¶
type CvConnectedComp C.CvConnectedComp
type CvContourScanner ¶
type CvContourScanner C.CvContourScanner
type CvContourTree ¶
type CvContourTree C.CvContourTree
type CvConvexityDefect ¶
type CvConvexityDefect C.CvConvexityDefect
type CvGraphEdge ¶
type CvGraphEdge C.CvGraphEdge
type CvGraphVtx ¶
type CvGraphVtx C.CvGraphVtx
type CvGraphVtx2D ¶
type CvGraphVtx2D C.CvGraphVtx2D
type CvHaarClassifierCascade ¶
type CvHaarClassifierCascade C.CvHaarClassifierCascade
type CvHaarFeature ¶
type CvHaarFeature C.CvHaarFeature
type CvHaarStageClassifier ¶
type CvHaarStageClassifier C.CvHaarStageClassifier
type CvHuMoments ¶
type CvHuMoments C.CvHuMoments
type CvMemBlock ¶
type CvMemBlock C.CvMemBlock
type CvMemStorage ¶
type CvMemStorage C.CvMemStorage
type CvMemStoragePos ¶
type CvMemStoragePos C.CvMemStoragePos
type CvNextEdgeType ¶
type CvNextEdgeType C.CvNextEdgeType
type CvQuadEdge2D ¶
type CvQuadEdge2D C.CvQuadEdge2D
type CvSeqBlock ¶
type CvSeqBlock C.CvSeqBlock
type CvSeqReader ¶
type CvSeqReader C.CvSeqReader
type CvSeqWriter ¶
type CvSeqWriter C.CvSeqWriter
type CvSubdiv2D ¶
type CvSubdiv2D C.CvSubdiv2D
type CvSubdiv2DEdge ¶
type CvSubdiv2DEdge C.CvSubdiv2DEdge
type CvSubdiv2DPoint ¶
type CvSubdiv2DPoint C.CvSubdiv2DPoint
type CvSubdiv2DPointLocation ¶
type CvSubdiv2DPointLocation C.CvSubdiv2DPointLocation
type HistType ¶
type HistType C.CvHistType
type Histogram ¶
type Histogram C.CvHistogram
type IplConvKernel ¶
type IplConvKernel C.IplConvKernel
type IplConvKernelFP ¶
type IplConvKernelFP C.IplConvKernelFP
type IplImage ¶
func CreateImage ¶
Creates IPL image (header and data)
func CreateImageHeader ¶
Allocates and initializes IplImage header
func (*IplImage) ColorModel ¶
func (*IplImage) GetChannels ¶
func (*IplImage) GetImageData ¶
func (*IplImage) GetImageSize ¶
func (*IplImage) GetWidthStep ¶
func (*IplImage) InitHeader ¶
Inializes IplImage header
func (*IplImage) ReleaseHeader ¶
func (img *IplImage) ReleaseHeader()
Releases (i.e. deallocates) IPL image header
type LineIterator ¶
type LineIterator C.CvLineIterator
type Mat ¶
func CreateMatHeader ¶
Allocates and initalizes CvMat header
func GetCols ¶
Selects column span of the input array: arr(:,start_col:end_col)
(end_col is not included into the span)
func GetDiag ¶
Select a diagonal of the input array.
(diag = 0 means the main diagonal, >0 means a diagonal above the main one, <0 - below the main one). The diagonal will be represented as a column (nx1 matrix).
func GetRows ¶
Selects row span of the input array: arr(start_row:delta_row:end_row,:)
(end_row is not included into the span).
func LoadImageM ¶
func (*Mat) InitHeader ¶
Initializes CvMat header
type MatND ¶
func CreateMatND ¶
Allocates and initializes CvMatND header and allocates data
func CreateMatNDHeader ¶
Allocates and initializes CvMatND header
func (*MatND) InitMatNDHeader ¶
Initializes preallocated CvMatND header
type MouseFuncA ¶
type MouseFuncA func(event, x, y, flags int)
type MouseFuncB ¶
type MouseFuncB func(event, x, y, flags int, param ...interface{})
type Point2D32f ¶
type Point2D64f ¶
type Point3D32f ¶
type Point3D64f ¶
type SparseMat ¶
type SparseMat C.CvSparseMat
func CreateSparseMat ¶
Allocates and initializes CvSparseMat header and allocates data
func (*SparseMat) InitSparseMatIterator ¶
func (mat *SparseMat) InitSparseMatIterator(iter *SparseMatIterator) *SparseNode
Initializes sparse array iterator
(returns the first node or NULL if the array is empty)
type SparseMatIterator ¶
type SparseMatIterator C.CvSparseMatIterator
func (*SparseMatIterator) CurIdx ¶
func (node *SparseMatIterator) CurIdx() int
func (*SparseMatIterator) Mat ¶
func (node *SparseMatIterator) Mat() *SparseMat
func (*SparseMatIterator) Next ¶
func (iter *SparseMatIterator) Next() *SparseNode
returns next sparse array node (or NULL if there is no more nodes)
func (*SparseMatIterator) Node ¶
func (node *SparseMatIterator) Node() *SparseNode
type SparseNode ¶
type SparseNode C.CvSparseNode
func (*SparseNode) HashVal ¶
func (node *SparseNode) HashVal() uint32
func (*SparseNode) Next ¶
func (node *SparseNode) Next() *SparseNode
type TermCriteria ¶
type TermCriteria C.CvTermCriteria
func (*TermCriteria) Epsilon ¶
func (x *TermCriteria) Epsilon() float64
func (*TermCriteria) Init ¶
func (x *TermCriteria) Init(type_, max_iter int, epsilon float64)
func (*TermCriteria) MaxIter ¶
func (x *TermCriteria) MaxIter() int
func (*TermCriteria) Type ¶
func (x *TermCriteria) Type() int
type TrackbarFuncA ¶
type TrackbarFuncA func(pos int)
type TrackbarFuncB ¶
type TrackbarFuncB func(pos int, param ...interface{})
type VideoWriter ¶
type VideoWriter C.CvVideoWriter
"black box" video file writer structure
func NewVideoWriter ¶
func NewVideoWriter(filename string, fourcc int32, fps float32, frame_width, frame_height, is_color int) *VideoWriter
initialize video file writer
func (*VideoWriter) WriteFrame ¶
func (writer *VideoWriter) WriteFrame(image *IplImage) int
write frame to video file
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
named window
func (*Window) CreateTrackbar ¶
func (win *Window) CreateTrackbar(name string, value, count int, on_changed TrackbarFunc, param ...interface{}) bool
create trackbar and display it on top of given window, set callback
func (*Window) Destroy ¶
func (win *Window) Destroy()
destroy window and all the trackers associated with it
func (*Window) GetHandle ¶
get native window handle (HWND in case of Win32 and Widget in case of X Window)
func (*Window) GetTrackbarPos ¶
retrieve or set trackbar position
func (*Window) GetWindowName ¶
get name of highgui window given its native handle
func (*Window) SetMouseCallback ¶
assign callback for mouse events