Documentation ¶
Overview ¶
Package gocv is a wrapper around the OpenCV 3.x computer vision library. It provides a Go language interface to the latest version of OpenCV.
OpenCV (Open Source Computer Vision Library: http://opencv.org) is an open-source BSD-licensed library that includes several hundreds of computer vision algorithms.
For further details, please see: http://docs.opencv.org/3.3.1/d1/dfb/intro.html
Index ¶
- Constants
- func AbsDiff(src1 Mat, src2 Mat, dst Mat)
- func Add(src1 Mat, src2 Mat, dst Mat)
- func AddWeighted(src1 Mat, alpha float64, src2 Mat, beta float64, gamma float64, dst Mat)
- func ArrowedLine(img Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int)
- func BilateralFilter(src Mat, dst Mat, d int, sigmaColor float64, sigmaSpace float64)
- func BitwiseAnd(src1 Mat, src2 Mat, dst Mat)
- func BitwiseNot(src1 Mat, dst Mat)
- func BitwiseOr(src1 Mat, src2 Mat, dst Mat)
- func BitwiseXor(src1 Mat, src2 Mat, dst Mat)
- func Blur(src Mat, dst Mat, ksize image.Point)
- func BoundingRect(contour []image.Point) image.Rectangle
- func CalcOpticalFlowFarneback(prevImg Mat, nextImg Mat, flow Mat, pyrScale float64, levels int, winsize int, ...)
- func CalcOpticalFlowPyrLK(prevImg Mat, nextImg Mat, prevPts Mat, nextPts Mat, status Mat, err Mat)
- func Canny(src Mat, edges Mat, t1 float32, t2 float32)
- func Circle(img Mat, center image.Point, radius int, c color.RGBA, thickness int)
- func ContourArea(contour []image.Point) float64
- func CornerSubPix(img Mat, corners Mat, winSize image.Point, zeroZone image.Point, ...)
- func CvtColor(src Mat, dst Mat, code ColorConversionCode)
- func DFT(src Mat, dst Mat)
- func Dilate(src Mat, dst Mat, kernel Mat)
- func Erode(src Mat, dst Mat, kernel Mat)
- func FindContours(src Mat, mode RetrievalMode, method ContourApproximationMode) [][]image.Point
- func GaussianBlur(src Mat, dst Mat, ksize image.Point, sigmaX float64, sigmaY float64, ...)
- func GetOptimalDFTSize(vecsize int) int
- func GetTextSize(text string, fontFace HersheyFont, fontScale float64, thickness int) image.Point
- func GoodFeaturesToTrack(img Mat, corners Mat, maxCorners int, quality float64, minDist float64)
- func HoughCircles(src Mat, circles Mat, method int, dp float64, minDist float64)
- func HoughLines(src Mat, lines Mat, rho float32, theta float32, threshold int)
- func HoughLinesP(src Mat, lines Mat, rho float32, theta float32, threshold int)
- func IMEncode(fileExt string, img Mat) (buf []byte, err error)
- func IMWrite(name string, img Mat) bool
- func IMWriteWithParams(name string, img Mat, params []int) bool
- func InRange(src Mat, lb Mat, ub Mat, dst Mat)
- func Laplacian(src Mat, dst Mat, dDepth int, kSize int, scale float64, delta float64, ...)
- func Line(img Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int)
- func MedianBlur(src Mat, dst Mat, ksize int)
- func Merge(src Mat, count int, dst Mat)
- func Moments(src Mat, binaryImage bool) map[string]float64
- func MorphologyEx(src Mat, dst Mat, op MorphType, kernel Mat)
- func Normalize(src Mat, dst Mat, alpha float64, beta float64, typ NormType)
- func OpenCVVersion() string
- func PutText(img Mat, text string, org image.Point, fontFace HersheyFont, fontScale float64, ...)
- func Rectangle(img Mat, r image.Rectangle, c color.RGBA, thickness int)
- func Resize(src, dst Mat, sz image.Point, fx, fy float64, interp InterpolationFlags)
- func Scharr(src Mat, dst Mat, dDepth int, dx int, dy int, scale float64, delta float64, ...)
- func Threshold(src Mat, dst Mat, thresh float32, maxvalue float32, typ ThresholdType)
- func Version() string
- func WaitKey(delay int) int
- type BackgroundSubtractor
- type BorderType
- type CascadeClassifier
- func (c *CascadeClassifier) Close() error
- func (c *CascadeClassifier) DetectMultiScale(img Mat) []image.Rectangle
- func (c *CascadeClassifier) DetectMultiScaleWithParams(img Mat, scale float64, minNeighbors, flags int, minSize, maxSize image.Point) []image.Rectangle
- func (c *CascadeClassifier) Load(name string) bool
- type ColorConversionCode
- type ContourApproximationMode
- type HOGDescriptor
- type HersheyFont
- type IMReadFlag
- type InterpolationFlags
- type Mat
- func (m *Mat) Clone() Mat
- func (m *Mat) Close() error
- func (m *Mat) Cols() int
- func (m *Mat) CopyTo(dst Mat)
- func (m *Mat) Empty() bool
- func (m *Mat) GetDoubleAt(row int, col int) float64
- func (m *Mat) GetFloatAt(row int, col int) float32
- func (m *Mat) GetIntAt(row int, col int) int32
- func (m *Mat) GetSCharAt(row int, col int) int8
- func (m *Mat) GetShortAt(row int, col int) int16
- func (m *Mat) GetUCharAt(row int, col int) int8
- func (m *Mat) Mean() Scalar
- func (m *Mat) Ptr() C.Mat
- func (m *Mat) Region(rio image.Rectangle) Mat
- func (m *Mat) Rows() int
- type MatType
- type MorphShape
- type MorphType
- type NormType
- type RetrievalMode
- type Scalar
- type TermCriteria
- type TermCriteriaType
- type ThresholdType
- type Trackbar
- type VideoCapture
- type VideoCaptureProperties
- type VideoWriter
- type Window
- type WindowFlag
- type WindowPropertyFlag
Constants ¶
const ( // MatTypeCV8U is a Mat of 8-bit unsigned int MatTypeCV8U MatType = 0 // MatTypeCV8S is a Mat of 8-bit signed int MatTypeCV8S = 1 // MatTypeCV16U is a Mat of 16-bit unsigned int MatTypeCV16U = 2 // MatTypeCV16S is a Mat of 16-bit signed int MatTypeCV16S = 3 // MatTypeCV32S is a Mat of 32-bit signed int MatTypeCV32S = 4 // MatTypeCV32F is a Mat of 32-bit float MatTypeCV32F = 5 // MatTypeCV64F is a Mat of 64-bit float MatTypeCV64F = 6 )
const ( NormInf NormType = 1 NormL1 = 2 NormL2 = 4 NormL2Sqr = 5 NormHamming = 6 NormHamming2 = 7 NormTypeMask = 7 NormRelative = 8 NormMixMax = 32 )
const ( // Count is the maximum number of iterations or elements to compute. Count TermCriteriaType = 1 // MaxIter is the maximum number of iterations or elements to compute. MaxIter = 1 // EPS is the desired accuracy or change in parameters at which the // iterative algorithm stops. EPS = 2 )
const ( WindowNormal WindowFlag = 0 WindowFullscreen = 1 WindowAutosize = 1 WindowFreeRatio = 0x00000100 WindowKeepRatio = 0 )
const ( // WindowPropertyFullscreen fullscreen property // (can be WINDOW_NORMAL or WINDOW_FULLSCREEN). WindowPropertyFullscreen WindowPropertyFlag = 0 // WindowPropertyAutosize is autosize property // (can be WINDOW_NORMAL or WINDOW_AUTOSIZE). WindowPropertyAutosize = 1 // WindowPropertyAspectRatio window's aspect ration // (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO). WindowPropertyAspectRatio = 2 // WindowPropertyOpenGL opengl support. WindowPropertyOpenGL = 3 // WindowPropertyVisible or not. WindowPropertyVisible = 4 )
const ( // IMReadUnchanged return the loaded image as is (with alpha channel, // otherwise it gets cropped). IMReadUnchanged IMReadFlag = -1 // IMReadGrayScale always convert image to the single channel // grayscale image. IMReadGrayScale = 0 // IMReadColor always converts image to the 3 channel BGR color image. IMReadColor = 1 // IMReadAnyDepth returns 16-bit/32-bit image when the input has the corresponding // depth, otherwise convert it to 8-bit. IMReadAnyDepth = 2 // IMReadAnyColor the image is read in any possible color format. IMReadAnyColor = 4 // IMReadLoadGDAL uses the gdal driver for loading the image. IMReadLoadGDAL = 8 // IMReadReducedGrayscale2 always converts image to the single channel grayscale image // and the image size reduced 1/2. IMReadReducedGrayscale2 = 16 // IMReadReducedColor2 always converts image to the 3 channel BGR color image and the // image size reduced 1/2. IMReadReducedColor2 = 17 // IMReadReducedGrayscale4 always converts image to the single channel grayscale image and // the image size reduced 1/4. IMReadReducedGrayscale4 = 32 // IMReadReducedColor4 always converts image to the 3 channel BGR color image and // the image size reduced 1/4. IMReadReducedColor4 = 33 // IMReadReducedGrayscale8 always convert image to the single channel grayscale image and // the image size reduced 1/8. IMReadReducedGrayscale8 = 64 // IMReadReducedColor8 always convert image to the 3 channel BGR color image and the // image size reduced 1/8. IMReadReducedColor8 = 65 // IMReadIgnoreOrientation do not rotate the image according to EXIF's orientation flag. IMReadIgnoreOrientation = 128 // For JPEG, it can be a quality from 0 to 100 (the higher is the better). Default value is 95. ImwriteJpegQuality = 1 // Enable JPEG features, 0 or 1, default is False. ImwriteJpegProgressive = 2 // Enable JPEG features, 0 or 1, default is False. ImwriteJpegOptimize = 3 // JPEG restart interval, 0 - 65535, default is 0 - no restart. ImwriteJpegRstInterval = 4 // Separate luma quality level, 0 - 100, default is 0 - don't use. ImwriteJpegLumaQuality = 5 // Separate chroma quality level, 0 - 100, default is 0 - don't use. ImwriteJpegChromaQuality = 6 // For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer compression time. // If specified, strategy is changed to IMWRITE_PNG_STRATEGY_DEFAULT (Z_DEFAULT_STRATEGY). // Default value is 1 (best speed setting). ImwritePngCompression = 16 // One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_RLE. ImwritePngStrategy = 17 // Binary level PNG, 0 or 1, default is 0. ImwritePngBilevel = 18 // For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1. ImwritePxmBinary = 32 // For WEBP, it can be a quality from 1 to 100 (the higher is the better). // By default (without any parameter) and for quality above 100 the lossless compression is used. ImwriteWebpQuality = 64 // For PAM, sets the TUPLETYPE field to the corresponding string value that is defined for the format. ImwritePamTupletype = 128 // Use this value for normal data. ImwritePngStrategyDefault = 0 // Use this value for data produced by a filter (or predictor). // Filtered data consists mostly of small values with a somewhat random distribution. // In this case, the compression algorithm is tuned to compress them better. ImwritePngStrategyFiltered = 1 // Use this value to force Huffman encoding only (no string match). ImwritePngStrategyHuffmanOnly = 2 // Use this value to limit match distances to one (run-length encoding). ImwritePngStrategyRle = 3 // Using this value prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. ImwritePngStrategyFixed = 4 )
const ( // RetrievalExternal retrieves only the extreme outer contours. // It sets `hierarchy[i][2]=hierarchy[i][3]=-1` for all the contours. RetrievalExternal RetrievalMode = 0 // RetrievalList retrieves all of the contours without establishing // any hierarchical relationships. RetrievalList = 1 // RetrievalCComp retrieves all of the contours and organizes them into // a two-level hierarchy. At the top level, there are external boundaries // of the components. At the second level, there are boundaries of the holes. // If there is another contour inside a hole of a connected component, it // is still put at the top level. RetrievalCComp = 2 // RetrievalTree retrieves all of the contours and reconstructs a full // hierarchy of nested contours. RetrievalTree = 3 // RetrievalFloodfill lacks a description in the original header. RetrievalFloodfill = 4 )
const ( // ChainApproxNone stores absolutely all the contour points. That is, // any 2 subsequent points (x1,y1) and (x2,y2) of the contour will be // either horizontal, vertical or diagonal neighbors, that is, // max(abs(x1-x2),abs(y2-y1))==1. ChainApproxNone ContourApproximationMode = 1 // ChainApproxSimple compresses horizontal, vertical, and diagonal segments // and leaves only their end points. // For example, an up-right rectangular contour is encoded with 4 points. ChainApproxSimple = 2 // ChainApproxTC89L1 applies one of the flavors of the Teh-Chin chain // approximation algorithms. ChainApproxTC89L1 = 3 // ChainApproxTC89KCOS applies one of the flavors of the Teh-Chin chain // approximation algorithms. ChainApproxTC89KCOS = 4 )
const ( // MorphRect is the rectangular morph shape. MorphRect MorphShape = 0 // MorphCross is the cross morph shape. MorphCross = 1 // MorphEllipse is the ellipse morph shape. MorphEllipse = 2 )
const ( // MorphErode operation MorphErode MorphType = 0 // MorphDilate operation MorphDilate = 1 // MorphOpen operation MorphOpen = 2 // MorphClose operation MorphClose = 3 // MorphGradient operation MorphGradient = 4 // MorphTophat operation MorphTophat = 5 // MorphBlackhat operation MorphBlackhat = 6 // MorphHitmiss operation MorphHitmiss = 7 )
const ( // BorderConstant border type BorderConstant BorderType = 0 // BorderReplicate border type BorderReplicate = 1 // BorderReflect border type BorderReflect = 2 // BorderWrap border type BorderWrap = 3 // BorderReflect101 border type BorderReflect101 = 4 // BorderTransparent border type BorderTransparent = 5 // BorderDefault border type BorderDefault = BorderReflect101 )
const ( // ThresholdBinary threshold type ThresholdBinary ThresholdType = 0 // ThresholdBinaryInv threshold type ThresholdBinaryInv = 1 // ThresholdTrunc threshold type ThresholdTrunc = 2 // ThresholdToZero threshold type ThresholdToZero = 3 // ThresholdToZeroInv threshold type ThresholdToZeroInv = 4 // ThresholdMask threshold type ThresholdMask = 7 // ThresholdOtsu threshold type ThresholdOtsu = 8 // ThresholdTriangle threshold type ThresholdTriangle = 16 )
const ( // FontHersheySimplex is normal size sans-serif font. FontHersheySimplex HersheyFont = 0 // FontHersheyPlain issmall size sans-serif font. FontHersheyPlain = 1 // FontHersheyDuplex normal size sans-serif font // (more complex than FontHersheySIMPLEX). FontHersheyDuplex = 2 // FontHersheyComplex i a normal size serif font. FontHersheyComplex = 3 // FontHersheyTriplex is a normal size serif font // (more complex than FontHersheyCOMPLEX). FontHersheyTriplex = 4 // FontHersheyComplexSmall is a smaller version of FontHersheyCOMPLEX. FontHersheyComplexSmall = 5 // FontHersheyScriptSimplex is a hand-writing style font. FontHersheyScriptSimplex = 6 // FontHersheyScriptComplex is a more complex variant of FontHersheyScriptSimplex. FontHersheyScriptComplex = 7 // FontItalic is the flag for italic font. FontItalic = 16 )
const ( // InterpolationNearestNeighbor is nearest neighbor. (fast but low quality) InterpolationNearestNeighbor InterpolationFlags = 0 // InterpolationLinear is bilinear interpolation. InterpolationLinear = 1 // InterpolationCubic is bicube interpolation. InterpolationCubic = 2 // InterpolationArea uses pixel area relation. It is preferred for image // decimation as it gives moire-free results. InterpolationArea = 3 // InterpolationLanczos4 is Lanczos interpolation over 8x8 neighborhood. InterpolationLanczos4 = 4 // InterpolationDefault is an alias for InterpolationLinear. InterpolationDefault = InterpolationLinear // Mask for interpolation codes. InterpolationMax = 7 )
const ( // ColorBGRToBGRA adds alpha channel to BGR image. ColorBGRToBGRA ColorConversionCode = 0 // ColorBGRAToBGR removes alpha channel from BGR image. ColorBGRAToBGR = 1 // ColorBGRToRGBA converts from BGR to RGB with alpha channel. ColorBGRToRGBA = 2 // ColorRGBAToBGR converts from RGB with alpha to BGR color space. ColorRGBAToBGR = 3 // ColorBGRToRGB converts from BGR to RGB without alpha channel. ColorBGRToRGB = 4 // ColorBGRAToRGBA converts from BGR with alpha channel // to RGB with alpha channel. ColorBGRAToRGBA = 5 // ColorBGRToGray converts from BGR to grayscale. ColorBGRToGray = 6 // ColorRGBToGray converts from RGB to grayscale. ColorRGBToGray = 7 // ColorGrayToBGR converts from grayscale to BGR. ColorGrayToBGR = 8 // ColorGrayToBGRA converts from grayscale to BGR with alpha channel. ColorGrayToBGRA = 9 // ColorBGRAToGray converts from BGR with alpha channel to grayscale. ColorBGRAToGray = 10 // ColorRGBAToGray converts from RGB with alpha channel to grayscale. ColorRGBAToGray = 11 // ColorBGRToBGR565 converts from BGR to BGR565 (16-bit images). ColorBGRToBGR565 = 12 // ColorRGBToBGR565 converts from RGB to BGR565 (16-bit images). ColorRGBToBGR565 = 13 // ColorBGR565ToBGR converts from BGR565 (16-bit images) to BGR. ColorBGR565ToBGR = 14 // ColorBGR565ToRGB converts from BGR565 (16-bit images) to RGB. ColorBGR565ToRGB = 15 // ColorBGRAToBGR565 converts from BGRA (with alpha channel) // to BGR565 (16-bit images). ColorBGRAToBGR565 = 16 // ColorRGBAToBGR565 converts from RGBA (with alpha channel) // to BGR565 (16-bit images). ColorRGBAToBGR565 = 17 // ColorBGR565ToBGRA converts from BGR565 (16-bit images) // to BGRA (with alpha channel). ColorBGR565ToBGRA = 18 // ColorBGR565ToRGBA converts from BGR565 (16-bit images) // to RGBA (with alpha channel). ColorBGR565ToRGBA = 19 // ColorGrayToBGR565 converts from grayscale // to BGR565 (16-bit images). ColorGrayToBGR565 = 20 // ColorBGR565ToGray converts from BGR565 (16-bit images) // to grayscale. ColorBGR565ToGray = 21 // ColorBGRToBGR555 converts from BGR to BGR555 (16-bit images). ColorBGRToBGR555 = 22 // ColorRGBToBGR555 converts from RGB to BGR555 (16-bit images). ColorRGBToBGR555 = 23 // ColorBGR555ToBGR converts from BGR555 (16-bit images) to BGR. ColorBGR555ToBGR = 24 // ColorBGR555ToRGB converts from BGR555 (16-bit images) to RGB. ColorBGR555ToRGB = 25 // ColorBGRAToBGR555 converts from BGRA (with alpha channel) // to BGR555 (16-bit images). ColorBGRAToBGR555 = 26 // ColorRGBAToBGR555 converts from RGBA (with alpha channel) // to BGR555 (16-bit images). ColorRGBAToBGR555 = 27 // ColorBGR555ToBGRA converts from BGR555 (16-bit images) // to BGRA (with alpha channel). ColorBGR555ToBGRA = 28 // ColorBGR555ToRGBA converts from BGR555 (16-bit images) // to RGBA (with alpha channel). ColorBGR555ToRGBA = 29 // ColorGrayToBGR555 converts from grayscale to BGR555 (16-bit images). ColorGrayToBGR555 = 30 // ColorBGR555ToGRAY converts from BGR555 (16-bit images) to grayscale. ColorBGR555ToGRAY = 31 // ColorBGRToXYZ converts from BGR to CIE XYZ. ColorBGRToXYZ = 32 // ColorRGBToXYZ converts from RGB to CIE XYZ. ColorRGBToXYZ = 33 // ColorXYZToBGR converts from CIE XYZ to BGR. ColorXYZToBGR = 34 // ColorXYZToRGB converts from CIE XYZ to RGB. ColorXYZToRGB = 35 // ColorBGRToYCrCb converts from BGR to luma-chroma (aka YCC). ColorBGRToYCrCb = 36 // ColorRGBToYCrCb converts from RGB to luma-chroma (aka YCC). ColorRGBToYCrCb = 37 // ColorYCrCbToBGR converts from luma-chroma (aka YCC) to BGR. ColorYCrCbToBGR = 38 // ColorYCrCbToRGB converts from luma-chroma (aka YCC) to RGB. ColorYCrCbToRGB = 39 // ColorBGRToHSV converts from BGR to HSV (hue saturation value). ColorBGRToHSV = 40 // ColorRGBToHSV converts from RGB to HSV (hue saturation value). ColorRGBToHSV = 41 // ColorBGRToLab converts from BGR to CIE Lab. ColorBGRToLab = 44 // ColorRGBToLab converts from RGB to CIE Lab. ColorRGBToLab = 45 // ColorBGRToLuv converts from BGR to CIE Luv. ColorBGRToLuv = 50 // ColorRGBToLuv converts from RGB to CIE Luv. ColorRGBToLuv = 51 // ColorBGRToHLS converts from BGR to HLS (hue lightness saturation). ColorBGRToHLS = 52 // ColorRGBToHLS converts from RGB to HLS (hue lightness saturation). ColorRGBToHLS = 53 // ColorHSVToBGR converts from HSV (hue saturation value) to BGR. ColorHSVToBGR = 54 // ColorHSVToRGB converts from HSV (hue saturation value) to RGB. ColorHSVToRGB = 55 // ColorLabToBGR converts from CIE Lab to BGR. ColorLabToBGR = 56 // ColorLabToRGB converts from CIE Lab to RGB. ColorLabToRGB = 57 // ColorLuvToBGR converts from CIE Luv to BGR. ColorLuvToBGR = 58 // ColorLuvToRGB converts from CIE Luv to RGB. ColorLuvToRGB = 59 // ColorHLSToBGR converts from HLS (hue lightness saturation) to BGR. ColorHLSToBGR = 60 // ColorHLSToRGB converts from HLS (hue lightness saturation) to RGB. ColorHLSToRGB = 61 // ColorBGRToHSVFull converts from BGR to HSV (hue saturation value) full. ColorBGRToHSVFull = 66 // ColorRGBToHSVFull converts from RGB to HSV (hue saturation value) full. ColorRGBToHSVFull = 67 // ColorBGRToHLSFull converts from BGR to HLS (hue lightness saturation) full. ColorBGRToHLSFull = 68 // ColorRGBToHLSFull converts from RGB to HLS (hue lightness saturation) full. ColorRGBToHLSFull = 69 // ColorHSVToBGRFull converts from HSV (hue saturation value) to BGR full. ColorHSVToBGRFull = 70 // ColorHSVToRGBFull converts from HSV (hue saturation value) to RGB full. ColorHSVToRGBFull = 71 // ColorHLSToBGRFull converts from HLS (hue lightness saturation) to BGR full. ColorHLSToBGRFull = 72 // ColorHLSToRGBFull converts from HLS (hue lightness saturation) to RGB full. ColorHLSToRGBFull = 73 // ColorLBGRToLab converts from LBGR to CIE Lab. ColorLBGRToLab = 74 // ColorLRGBToLab converts from LRGB to CIE Lab. ColorLRGBToLab = 75 // ColorLBGRToLuv converts from LBGR to CIE Luv. ColorLBGRToLuv = 76 // ColorLRGBToLuv converts from LRGB to CIE Luv. ColorLRGBToLuv = 77 // ColorLabToLBGR converts from CIE Lab to LBGR. ColorLabToLBGR = 78 // ColorLabToLRGB converts from CIE Lab to LRGB. ColorLabToLRGB = 79 // ColorLuvToLBGR converts from CIE Luv to LBGR. ColorLuvToLBGR = 80 // ColorLuvToLRGB converts from CIE Luv to LRGB. ColorLuvToLRGB = 81 // ColorBGRToYUV converts from BGR to YUV. ColorBGRToYUV = 82 // ColorRGBToYUV converts from RGB to YUV. ColorRGBToYUV = 83 // ColorYUVToBGR converts from YUV to BGR. ColorYUVToBGR = 84 // ColorYUVToRGB converts from YUV to RGB. ColorYUVToRGB = 85 // ColorYUVToRGBNV12 converts from YUV 4:2:0 to RGB NV12. ColorYUVToRGBNV12 = 90 // ColorYUVToBGRNV12 converts from YUV 4:2:0 to BGR NV12. ColorYUVToBGRNV12 = 91 // ColorYUVToRGBNV21 converts from YUV 4:2:0 to RGB NV21. ColorYUVToRGBNV21 = 92 // ColorYUVToBGRNV21 converts from YUV 4:2:0 to BGR NV21. ColorYUVToBGRNV21 = 93 // ColorYUVToRGBANV12 converts from YUV 4:2:0 to RGBA NV12. ColorYUVToRGBANV12 = 94 // ColorYUVToBGRANV12 converts from YUV 4:2:0 to BGRA NV12. ColorYUVToBGRANV12 = 95 // ColorYUVToRGBANV21 converts from YUV 4:2:0 to RGBA NV21. ColorYUVToRGBANV21 = 96 // ColorYUVToBGRANV21 converts from YUV 4:2:0 to BGRA NV21. ColorYUVToBGRANV21 = 97 ColorYUVToRGBYV12 = 98 ColorYUVToBGRYV12 = 99 ColorYUVToRGBIYUV = 100 ColorYUVToBGRIYUV = 101 ColorYUVToRGBAYV12 = 102 ColorYUVToBGRAYV12 = 103 ColorYUVToRGBAIYUV = 104 ColorYUVToBGRAIYUV = 105 ColorYUVToGRAY420 = 106 // YUV 4:2:2 family to RGB ColorYUVToRGBUYVY = 107 ColorYUVToBGRUYVY = 108 ColorYUVToRGBAUYVY = 111 ColorYUVToBGRAUYVY = 112 ColorYUVToRGBYUY2 = 115 ColorYUVToBGRYUY2 = 116 ColorYUVToRGBYVYU = 117 ColorYUVToBGRYVYU = 118 ColorYUVToRGBAYUY2 = 119 ColorYUVToBGRAYUY2 = 120 ColorYUVToRGBAYVYU = 121 ColorYUVToBGRAYVYU = 122 ColorYUVToGRAYUYVY = 123 ColorYUVToGRAYYUY2 = 124 // alpha premultiplication ColorRGBATomRGBA = 125 ColormRGBAToRGBA = 126 // RGB to YUV 4:2:0 family ColorRGBToYUVI420 = 127 ColorBGRToYUVI420 = 128 ColorRGBAToYUVI420 = 129 ColorBGRAToYUVI420 = 130 ColorRGBToYUVYV12 = 131 ColorBGRToYUVYV12 = 132 ColorRGBAToYUVYV12 = 133 ColorBGRAToYUVYV12 = 134 // Demosaicing ColorBayerBGToBGR = 46 ColorBayerGBToBGR = 47 ColorBayerRGToBGR = 48 ColorBayerGRToBGR = 49 ColorBayerBGToGRAY = 86 ColorBayerGBToGRAY = 87 ColorBayerRGToGRAY = 88 ColorBayerGRToGRAY = 89 // Demosaicing using Variable Number of Gradients ColorBayerBGToBGRVNG = 62 ColorBayerGBToBGRVNG = 63 ColorBayerRGToBGRVNG = 64 ColorBayerGRToBGRVNG = 65 // Edge-Aware Demosaicing ColorBayerBGToBGREA = 135 ColorBayerGBToBGREA = 136 ColorBayerRGToBGREA = 137 ColorBayerGRToBGREA = 138 // Demosaicing with alpha channel ColorBayerBGToBGRA = 139 ColorBayerGBToBGRA = 140 ColorBayerRGToBGRA = 141 ColorBayerGRToBGRA = 142 ColorCOLORCVTMAX = 143 )
const ( // VideoCapturePosMsec contains current position of the // video file in milliseconds. VideoCapturePosMsec VideoCaptureProperties = 0 // VideoCapturePosFrames 0-based index of the frame to be // decoded/captured next. VideoCapturePosFrames = 1 // VideoCapturePosAVIRatio relative position of the video file: // 0=start of the film, 1=end of the film. VideoCapturePosAVIRatio = 2 // VideoCaptureFrameWidth is width of the frames in the video stream. VideoCaptureFrameWidth = 3 // VideoCaptureFrameHeight controls height of frames in the video stream. VideoCaptureFrameHeight = 4 // VideoCaptureFPS controls capture frame rate. VideoCaptureFPS = 5 // VideoCaptureFOURCC contains the 4-character code of codec. // see VideoWriter::fourcc for details. VideoCaptureFOURCC = 6 // VideoCaptureFrameCount contains number of frames in the video file. VideoCaptureFrameCount = 7 // VideoCaptureFormat format of the Mat objects returned by // VideoCapture::retrieve(). VideoCaptureFormat = 8 // VideoCaptureMode contains backend-specific value indicating // the current capture mode. VideoCaptureMode = 9 // VideoCaptureBrightness is brightness of the image // (only for those cameras that support). VideoCaptureBrightness = 10 // VideoCaptureContrast is contrast of the image // (only for cameras that support it). VideoCaptureContrast = 11 // VideoCaptureSaturation saturation of the image // (only for cameras that support). VideoCaptureSaturation = 12 // VideoCaptureHue hue of the image (only for cameras that support). VideoCaptureHue = 13 // VideoCaptureGain is the gain of the capture image. // (only for those cameras that support). VideoCaptureGain = 14 // VideoCaptureExposure is the exposure of the capture image. // (only for those cameras that support). VideoCaptureExposure = 15 // VideoCaptureConvertRGB is a boolean flags indicating whether // images should be converted to RGB. VideoCaptureConvertRGB = 16 // VideoCaptureWhiteBalanceBlueU is currently unsupported. VideoCaptureWhiteBalanceBlueU = 17 // VideoCaptureRectification is the rectification flag for stereo cameras. // Note: only supported by DC1394 v 2.x backend currently. VideoCaptureRectification = 18 // VideoCaptureMonochrome indicates whether images should be // converted to monochrome. VideoCaptureMonochrome = 19 // VideoCaptureSharpness controls image capture sharpness. VideoCaptureSharpness = 20 // VideoCaptureAutoExposure controls the DC1394 exposure control // done by camera, user can adjust reference level using this feature. VideoCaptureAutoExposure = 21 // VideoCaptureGamma controls video capture gamma. VideoCaptureGamma = 22 // VideoCaptureTemperature controls video capture temperature. VideoCaptureTemperature = 23 // VideoCaptureTrigger controls video capture trigger. VideoCaptureTrigger = 24 // VideoCaptureTriggerDelay controls video capture trigger delay. VideoCaptureTriggerDelay = 25 // VideoCaptureWhiteBalanceRedV controls video capture setting for // white balance. VideoCaptureWhiteBalanceRedV = 26 // VideoCaptureZoom controls video capture zoom. VideoCaptureZoom = 27 // VideoCaptureFocus controls video capture focus. VideoCaptureFocus = 28 // VideoCaptureGUID controls video capture GUID. VideoCaptureGUID = 29 // VideoCaptureISOSpeed controls video capture ISO speed. VideoCaptureISOSpeed = 30 // VideoCaptureBacklight controls video capture backlight. VideoCaptureBacklight = 32 // VideoCapturePan controls video capture pan. VideoCapturePan = 33 // VideoCaptureTilt controls video capture tilt. VideoCaptureTilt = 34 // VideoCaptureRoll controls video capture roll. VideoCaptureRoll = 35 // VideoCaptureIris controls video capture iris. VideoCaptureIris = 36 // VideoCaptureSettings is the pop up video/camera filter dialog. Note: // only supported by DSHOW backend currently. The property value is ignored. VideoCaptureSettings = 37 // VideoCaptureBufferSize controls video capture buffer size. VideoCaptureBufferSize = 38 // VideoCaptureAutoFocus controls video capture auto focus.. VideoCaptureAutoFocus = 39 )
const GoCVVersion = "0.5.0"
GoCVVersion of this package, for display purposes.
Variables ¶
This section is empty.
Functions ¶
func AbsDiff ¶ added in v0.3.0
AbsDiff calculates the per-element absolute difference between two arrays or between an array and a scalar.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga6fef31bc8c4071cbc114a758a2b79c14
func Add ¶ added in v0.3.0
Add calculates the per-element sum of two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga10ac1bfb180e2cfda1701d06c24fdbd6
func AddWeighted ¶ added in v0.3.0
AddWeighted calculates the weighted sum of two arrays.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gafafb2513349db3bcff51f54ee5592a19
func ArrowedLine ¶ added in v0.3.0
ArrowedLine draws a arrow segment pointing from the first point to the second one.
For further details, please see: https://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga0a165a3ca093fd488ac709fdf10c05b2
func BilateralFilter ¶ added in v0.3.0
BilateralFilter applies the bilateral filter to an image. The function applies bilateral filtering to the input image, as described in http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters.
For further details, please see: https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed
func BitwiseAnd ¶ added in v0.3.0
BitwiseAnd computes bitwise conjunction of the two arrays (dst = src1 & src2). Calculates the per-element bit-wise conjunction of two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga60b4d04b251ba5eb1392c34425497e14
func BitwiseNot ¶ added in v0.3.0
BitwiseNot inverts every bit of an array.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga0002cf8b418479f4cb49a75442baee2f
func BitwiseOr ¶ added in v0.3.0
BitwiseOr calculates the per-element bit-wise disjunction of two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gab85523db362a4e26ff0c703793a719b4
func BitwiseXor ¶ added in v0.3.0
BitwiseXor calculates the per-element bit-wise "exclusive or" operation on two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga84b2d8188ce506593dcc3f8cd00e8e2c
func Blur ¶
Blur blurs an image Mat using a box filter. The function convolves the src Mat image into the dst Mat using the specified Gaussian kernel params.
For further details, please see: http://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1
func BoundingRect ¶ added in v0.4.1
BoundingRect calculates the up-right bounding rectangle of a point set.
For further details, please see: https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#gacb413ddce8e48ff3ca61ed7cf626a366
func CalcOpticalFlowFarneback ¶ added in v0.5.0
func CalcOpticalFlowFarneback(prevImg Mat, nextImg Mat, flow Mat, pyrScale float64, levels int, winsize int, iterations int, polyN int, polySigma float64, flags int)
CalcOpticalFlowFarneback computes a dense optical flow using Gunnar Farneback's algorithm.
For further details, please see: https://docs.opencv.org/3.3.1/dc/d6b/group__video__track.html#ga5d10ebbd59fe09c5f650289ec0ece5af
func CalcOpticalFlowPyrLK ¶ added in v0.5.0
CalcOpticalFlowPyrLK calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with pyramids.
For further details, please see: https://docs.opencv.org/3.3.1/dc/d6b/group__video__track.html#ga473e4b886d0bcc6b65831eb88ed93323
func Canny ¶
Canny finds edges in an image using the Canny algorithm. The function finds edges in the input image image and marks them in the output map edges using the Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The largest value is used to find initial segments of strong edges. See http://en.wikipedia.org/wiki/Canny_edge_detector
For further details, please see: http://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de
func Circle ¶ added in v0.3.0
Circle draws a circle.
For further details, please see: https://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670
func ContourArea ¶ added in v0.4.1
ContourArea calculates a contour area.
For further details, please see: https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#ga2c759ed9f497d4a618048a2f56dc97f1
func CornerSubPix ¶ added in v0.5.0
func CornerSubPix(img Mat, corners Mat, winSize image.Point, zeroZone image.Point, criteria TermCriteria)
CornerSubPix Refines the corner locations. The function iterates to find the sub-pixel accurate location of corners or radial saddle points.
For further details, please see: https://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga354e0d7c86d0d9da75de9b9701a9a87e
func CvtColor ¶
func CvtColor(src Mat, dst Mat, code ColorConversionCode)
CvtColor converts an image from one color space to another. It converts the src Mat image to the dst Mat using the code param containing the desired ColorConversionCode color space.
For further details, please see: http://docs.opencv.org/3.3.1/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
func DFT ¶ added in v0.3.0
DFT performs a forward or inverse Discrete Fourier Transform (DFT) of a 1D or 2D floating-point array.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gadd6cf9baf2b8b704a11b5f04aaf4f39d
func Dilate ¶ added in v0.3.0
Dilate dilates an image by using a specific structuring element.
For further details, please see: https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c
func Erode ¶ added in v0.3.0
Erode erodes an image by using a specific structuring element.
For further details, please see: https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb
func FindContours ¶ added in v0.4.1
func FindContours(src Mat, mode RetrievalMode, method ContourApproximationMode) [][]image.Point
FindContours finds contours in a binary image.
For further details, please see: https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#ga17ed9f5d79ae97bd4c7cf18403e1689a
func GaussianBlur ¶
func GaussianBlur(src Mat, dst Mat, ksize image.Point, sigmaX float64, sigmaY float64, borderType BorderType)
GaussianBlur blurs an image Mat using a Gaussian filter. The function convolves the src Mat image into the dst Mat using the specified Gaussian kernel params.
For further details, please see: http://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1
func GetOptimalDFTSize ¶ added in v0.3.0
GetOptimalDFTSize returns the optimal Discrete Fourier Transform (DFT) size for a given vector size.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga6577a2e59968936ae02eb2edde5de299
func GetTextSize ¶
GetTextSize calculates the width and height of a text string. It returns an image.Point with the size required to draw text using a specific font face, scale, and thickness.
For further details, please see: http://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga3d2abfcb995fd2db908c8288199dba82
func GoodFeaturesToTrack ¶ added in v0.5.0
GoodFeaturesToTrack determines strong corners on an image. The function finds the most prominent corners in the image or in the specified image region.
For further details, please see: https://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541
func HoughCircles ¶ added in v0.3.0
HoughCircles finds circles in a grayscale image using the Hough transform. The only "method" currently supported is HOUGH_GRADIENT = 3.
For further details, please see: https://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d
func HoughLines ¶
HoughLines implements the standard or standard multi-scale Hough transform algorithm for line detection. For a good explanation of Hough transform, see: http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
For further details, please see: http://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga46b4e588934f6c8dfd509cc6e0e4545a
func HoughLinesP ¶
HoughLinesP implements the probabilistic Hough transform algorithm for line detection. For a good explanation of Hough transform, see: http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
For further details, please see: http://docs.opencv.org/3.3.1/dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb
func IMEncode ¶
IMEncode encodes an image Mat into a memory buffer. This function compresses the image and stores it in the returned memory buffer, using the image format passed in in the form of a file extension string.
For further details, please see: http://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#ga461f9ac09887e47797a54567df3b8b63
func IMWrite ¶
IMWrite writes a Mat to an image file.
For further details, please see: http://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce
func IMWriteWithParams ¶ added in v0.4.1
IMWrite writes a Mat to an image file. With that func you can pass compression parameters
For further details, please see: http://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce
func InRange ¶ added in v0.3.0
InRange checks if array elements lie between the elements of two Mat arrays.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981
func Laplacian ¶ added in v0.4.1
func Laplacian(src Mat, dst Mat, dDepth int, kSize int, scale float64, delta float64, borderType BorderType)
Laplacian calculates the Laplacian of an image.
For further details, please see: https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6
func Line ¶ added in v0.3.0
Line draws a line segment connecting two points.
For further details, please see: https://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2
func MedianBlur ¶ added in v0.3.0
MedianBlur blurs an image using the median filter.
For further details, please see: https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9
func Merge ¶ added in v0.3.0
Merge creates one multi-channel array out of several single-channel ones.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga7d7b4d6c6ee504b30a20b1680029c7b4
func Moments ¶ added in v0.4.1
Moments calculates all of the moments up to the third order of a polygon or rasterized shape.
For further details, please see: https://docs.opencv.org/3.3.1/d3/dc0/group__imgproc__shape.html#ga556a180f43cab22649c23ada36a8a139
func MorphologyEx ¶ added in v0.3.0
MorphologyEx performs advanced morphological transformations.
For further details, please see: https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f
func Normalize ¶ added in v0.3.0
Normalize normalizes the norm or value range of an array.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#ga87eef7ee3970f86906d69a92cbf064bd
func OpenCVVersion ¶
func OpenCVVersion() string
OpenCVVersion returns the current OpenCV lib version
func PutText ¶
func PutText(img Mat, text string, org image.Point, fontFace HersheyFont, fontScale float64, c color.RGBA, thickness int)
PutText draws a text string. It renders the specified text string into the img Mat at the location passed in the "org" param, using the desired font face, font scale, color, and line thinkness.
For further details, please see: http://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga5126f47f883d730f633d74f07456c576
func Rectangle ¶
Rectangle draws a simple, thick, or filled up-right rectangle. It renders a rectangle with the desired characteristics to the target Mat image.
For further details, please see: http://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga346ac30b5c74e9b5137576c9ee9e0e8c
func Resize ¶ added in v0.3.0
func Resize(src, dst Mat, sz image.Point, fx, fy float64, interp InterpolationFlags)
Resize resizes an image. It resizes the image src down to or up to the specified size, storing the result in dst. Note that src and dst may be the same image. If you wish to scale by factor, an empty sz may be passed and non-zero fx and fy. Likewise, if you wish to scale to an explicit size, a non-empty sz may be passed with zero for both fx and fy.
For further details, please see: https://docs.opencv.org/3.3.1/da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d
func Scharr ¶ added in v0.4.1
func Scharr(src Mat, dst Mat, dDepth int, dx int, dy int, scale float64, delta float64, borderType BorderType)
Scharr calculates the first x- or y- image derivative using Scharr operator.
For further details, please see: https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9
func Threshold ¶ added in v0.4.1
func Threshold(src Mat, dst Mat, thresh float32, maxvalue float32, typ ThresholdType)
Threshold applies a fixed-level threshold to each array element.
For further details, please see: https://docs.opencv.org/3.3.0/d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57
func WaitKey ¶
WaitKey waits for a pressed key. This function is the only method in OpenCV's HighGUI that can fetch and handle events, so it needs to be called periodically for normal event processing
For further details, please see: http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7
Types ¶
type BackgroundSubtractor ¶ added in v0.3.0
type BackgroundSubtractor struct {
// contains filtered or unexported fields
}
BackgroundSubtractor is a wrapper around the cv::BackgroundSubtractor.
func NewBackgroundSubtractorKNN ¶ added in v0.3.0
func NewBackgroundSubtractorKNN() BackgroundSubtractor
NewBackgroundSubtractorKNN returns a new BackgroundSubtractor algorithm of type KNN. K-Nearest Neighbors (KNN) uses a Background/Foreground Segmentation Algorithm
For further details, please see: https://docs.opencv.org/3.3.1/db/d88/classcv_1_1BackgroundSubtractorKNN.html
func NewBackgroundSubtractorMOG2 ¶ added in v0.3.0
func NewBackgroundSubtractorMOG2() BackgroundSubtractor
NewBackgroundSubtractorMOG2 returns a new BackgroundSubtractor algorithm of type MOG2. MOG2 is a Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
For further details, please see: https://docs.opencv.org/3.3.1/d7/d7b/classcv_1_1BackgroundSubtractorMOG2.html
func (*BackgroundSubtractor) Apply ¶ added in v0.3.0
func (b *BackgroundSubtractor) Apply(src Mat, dst Mat)
Apply computes a foreground mask using the current BackgroundSubtractor.
For further details, please see: https://docs.opencv.org/3.3.1/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21
func (*BackgroundSubtractor) Close ¶ added in v0.3.0
func (b *BackgroundSubtractor) Close() error
Close BackgroundSubtractor.
type CascadeClassifier ¶
type CascadeClassifier struct {
// contains filtered or unexported fields
}
CascadeClassifier is a cascade classifier class for object detection.
For further details, please see: http://docs.opencv.org/3.3.1/d1/de5/classcv_1_1CascadeClassifier.html
func NewCascadeClassifier ¶
func NewCascadeClassifier() CascadeClassifier
NewCascadeClassifier returns a new CascadeClassifier.
func (*CascadeClassifier) Close ¶
func (c *CascadeClassifier) Close() error
Close deletes the CascadeClassifier's pointer.
func (*CascadeClassifier) DetectMultiScale ¶
func (c *CascadeClassifier) DetectMultiScale(img Mat) []image.Rectangle
DetectMultiScale detects objects of different sizes in the input Mat image. The detected objects are returned as a slice of image.Rectangle structs.
For further details, please see: http://docs.opencv.org/3.3.1/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
func (*CascadeClassifier) DetectMultiScaleWithParams ¶ added in v0.5.0
func (c *CascadeClassifier) DetectMultiScaleWithParams(img Mat, scale float64, minNeighbors, flags int, minSize, maxSize image.Point) []image.Rectangle
DetectMultiScaleWithParams calls DetectMultiScale but allows setting parameters to values other than just the defaults.
For further details, please see: http://docs.opencv.org/3.3.1/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
func (*CascadeClassifier) Load ¶
func (c *CascadeClassifier) Load(name string) bool
Load cascade classifier from a file.
For further details, please see: http://docs.opencv.org/3.3.1/d1/de5/classcv_1_1CascadeClassifier.html#a1a5884c8cc749422f9eb77c2471958bc
type ColorConversionCode ¶
type ColorConversionCode int
ColorConversionCode is a color conversion code used on Mat.
For further details, please see: http://docs.opencv.org/3.3.1/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
type ContourApproximationMode ¶ added in v0.4.1
type ContourApproximationMode int
ContourApproximationMode is the mode of the contour approximation algorithm.
type HOGDescriptor ¶ added in v0.3.0
type HOGDescriptor struct {
// contains filtered or unexported fields
}
HOGDescriptor is a Histogram Of Gradiants (HOG) for object detection.
For further details, please see: https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a723b95b709cfd3f95cf9e616de988fc8
func NewHOGDescriptor ¶ added in v0.3.0
func NewHOGDescriptor() HOGDescriptor
NewHOGDescriptor returns a new HOGDescriptor.
func (*HOGDescriptor) Close ¶ added in v0.3.0
func (h *HOGDescriptor) Close() error
Close deletes the HOGDescriptor's pointer.
func (*HOGDescriptor) DetectMultiScale ¶ added in v0.3.0
func (h *HOGDescriptor) DetectMultiScale(img Mat) []image.Rectangle
DetectMultiScale detects objects in the input Mat image. The detected objects are returned as a slice of image.Rectangle structs.
For further details, please see: https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
func (*HOGDescriptor) DetectMultiScaleWithParams ¶ added in v0.5.0
func (h *HOGDescriptor) DetectMultiScaleWithParams(img Mat, hitThresh float64, winStride, padding image.Point, scale, finalThreshold float64, useMeanshiftGrouping bool) []image.Rectangle
DetectMultiScaleWithParams calls DetectMultiScale but allows setting parameters to values other than just the defaults.
For further details, please see: https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
func (*HOGDescriptor) SetSVMDetector ¶ added in v0.3.0
func (h *HOGDescriptor) SetSVMDetector(det Mat) error
SetSVMDetector sets the data for the HOGDescriptor.
For further details, please see: https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a09e354ad701f56f9c550dc0385dc36f1
type HersheyFont ¶
type HersheyFont int
HersheyFont are the font libraries included in OpenCV. Only a subset of the available Hershey fonts are supported by OpenCV.
For more information, see: http://sources.isc.org/utils/misc/hershey-font.txt
type IMReadFlag ¶
type IMReadFlag int
IMReadFlag is one of the valid flags to use for the IMRead function.
type InterpolationFlags ¶ added in v0.3.0
type InterpolationFlags int
InterpolationFlags are bit flags that control the interpolation algorithm that is used.
type Mat ¶
type Mat struct {
// contains filtered or unexported fields
}
Mat represents an n-dimensional dense numerical single-channel or multi-channel array. It can be used to store real or complex-valued vectors and matrices, grayscale or color images, voxel volumes, vector fields, point clouds, tensors, and histograms.
For further details, please see: http://docs.opencv.org/3.3.1/d3/d63/classcv_1_1Mat.html
func GetStructuringElement ¶ added in v0.3.0
func GetStructuringElement(shape MorphShape, ksize image.Point) Mat
GetStructuringElement returns a structuring element of the specified size and shape for morphological operations.
For further details, please see: https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc
func HOGDefaultPeopleDetector ¶ added in v0.3.0
func HOGDefaultPeopleDetector() Mat
HOGDefaultPeopleDetector returns a new Mat with the HOG DefaultPeopleDetector.
For further details, please see: https://docs.opencv.org/3.3.1/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
func IMRead ¶
func IMRead(name string, flags IMReadFlag) Mat
IMRead reads an image from a file into a Mat. The flags param is one of the IMReadFlag flags. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty Mat.
For further details, please see: http://docs.opencv.org/3.3.1/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56
func NewMatFromScalar ¶ added in v0.3.0
NewMatFromScalar returns a new Mat for a specific Scalar value
func NewMatWithSize ¶
NewMatWithSize returns a new Mat with a specific size and type.
func (*Mat) GetDoubleAt ¶
GetDoubleAt returns a value from a specific row/col in this Mat expecting it to be of type double aka CV_64F.
func (*Mat) GetFloatAt ¶
GetFloatAt returns a value from a specific row/col in this Mat expecting it to be of type float aka CV_32F.
func (*Mat) GetIntAt ¶
GetIntAt returns a value from a specific row/col in this Mat expecting it to be of type int aka CV_32S.
func (*Mat) GetSCharAt ¶
GetSCharAt returns a value from a specific row/col in this Mat expecting it to be of type schar aka CV_8S.
func (*Mat) GetShortAt ¶
GetShortAt returns a value from a specific row/col in this Mat expecting it to be of type short aka CV_16S.
func (*Mat) GetUCharAt ¶
GetUCharAt returns a value from a specific row/col in this Mat expecting it to be of type uchar aka CV_8U.
func (*Mat) Mean ¶ added in v0.4.1
Mean calculates the mean value M of array elements, independently for each channel, and return it as Scalar TODO pass second paramter with mask
type MatType ¶
type MatType int
MatType is the type for the various different kinds of Mat you can create.
type MorphShape ¶ added in v0.3.0
type MorphShape int
MorphShape is the shape of the structuring element used for Morphing operations.
type NormType ¶ added in v0.3.0
type NormType int
NormType for normalization operations.
For further details, please see: https://docs.opencv.org/3.3.1/d2/de8/group__core__array.html#gad12cefbcb5291cf958a85b4b67b6149f
type RetrievalMode ¶ added in v0.4.1
type RetrievalMode int
RetrievalMode is the mode of the contour retrieval algorithm.
type Scalar ¶
Scalar is a 4-element vector widely used in OpenCV to pass pixel values.
For further details, please see: http://docs.opencv.org/3.3.1/d1/da0/classcv_1_1Scalar__.html
type TermCriteria ¶ added in v0.5.0
type TermCriteria struct {
// contains filtered or unexported fields
}
TermCriteria is the criteria for iterative algorithms.
For further details, please see: https://docs.opencv.org/3.3.1/d9/d5d/classcv_1_1TermCriteria.html
func NewTermCriteria ¶ added in v0.5.0
func NewTermCriteria(typ TermCriteriaType, maxCount int, epsilon float64) TermCriteria
NewTermCriteria returns a new TermCriteria.
type TermCriteriaType ¶ added in v0.5.0
type TermCriteriaType int
TermCriteriaType for TermCriteria.
For further details, please see: https://docs.opencv.org/3.3.1/d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57
type ThresholdType ¶ added in v0.4.1
type ThresholdType int
ThresholdType type of threshold operation.
type Trackbar ¶ added in v0.3.0
type Trackbar struct {
// contains filtered or unexported fields
}
Trackbar is a wrapper around OpenCV's "HighGUI" window Trackbars.
func (*Trackbar) GetPos ¶ added in v0.3.0
GetPos returns the trackbar position.
For further details, please see: https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga122632e9e91b9ec06943472c55d9cda8
func (*Trackbar) SetMax ¶ added in v0.3.0
SetMax sets the trackbar maximum position.
For further details, please see: https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga7e5437ccba37f1154b65210902fc4480
func (*Trackbar) SetMin ¶ added in v0.3.0
SetMin sets the trackbar minimum position.
For further details, please see: https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#gabe26ffe8d2b60cc678895595a581b7aa
func (*Trackbar) SetPos ¶ added in v0.3.0
SetPos sets the trackbar position.
For further details, please see: https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga67d73c4c9430f13481fd58410d01bd8d
type VideoCapture ¶
type VideoCapture struct {
// contains filtered or unexported fields
}
VideoCapture is a wrapper around the OpenCV VideoCapture class.
For further details, please see: http://docs.opencv.org/3.3.1/d8/dfe/classcv_1_1VideoCapture.html
func VideoCaptureDevice ¶
func VideoCaptureDevice(device int) (vc *VideoCapture, err error)
VideoCaptureDevice opens a VideoCapture from a device and prepares to start capturing.
func VideoCaptureFile ¶
func VideoCaptureFile(uri string) (vc *VideoCapture, err error)
VideoCaptureFile opens a VideoCapture from a file and prepares to start capturing.
func (VideoCapture) Get ¶ added in v0.3.0
func (v VideoCapture) Get(prop VideoCaptureProperties) float64
Get parameter with property (=key).
func (*VideoCapture) Grab ¶
func (v *VideoCapture) Grab(skip int)
Grab skips a specific number of frames.
func (*VideoCapture) IsOpened ¶
func (v *VideoCapture) IsOpened() bool
IsOpened returns if the VideoCapture has been opened to read from a file or capture device.
func (*VideoCapture) Read ¶
func (v *VideoCapture) Read(m Mat) bool
Read read the next frame from the VideoCapture to the Mat passed in as the parem. It returns false if the VideoCapture cannot read frame.
func (*VideoCapture) Set ¶
func (v *VideoCapture) Set(prop VideoCaptureProperties, param float64)
Set parameter with property (=key).
type VideoCaptureProperties ¶
type VideoCaptureProperties int
VideoCaptureProperties are the properties used for VideoCapture operations.
type VideoWriter ¶
type VideoWriter struct {
// contains filtered or unexported fields
}
VideoWriter is a wrapper around the OpenCV VideoWriter`class.
For further details, please see: http://docs.opencv.org/3.3.1/dd/d9e/classcv_1_1VideoWriter.html
func VideoWriterFile ¶
func VideoWriterFile(name string, codec string, fps float64, width int, height int) (vw *VideoWriter, err error)
VideoWriterFile opens a VideoWriter with a specific output file. The "codec" param should be the four-letter code for the desired output codec, for example "MJPG".
For further details, please see: http://docs.opencv.org/3.3.1/dd/d9e/classcv_1_1VideoWriter.html#a0901c353cd5ea05bba455317dab81130
func (*VideoWriter) IsOpened ¶
func (vw *VideoWriter) IsOpened() bool
IsOpened checks if the VideoWriter is open and ready to be written to.
For further details, please see: http://docs.opencv.org/3.3.1/dd/d9e/classcv_1_1VideoWriter.html#a9a40803e5f671968ac9efa877c984d75
func (*VideoWriter) Write ¶
func (vw *VideoWriter) Write(img Mat) error
Write the next video frame from the Mat image to the open VideoWriter.
For further details, please see: http://docs.opencv.org/3.3.1/dd/d9e/classcv_1_1VideoWriter.html#a3115b679d612a6a0b5864a0c88ed4b39
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window is a wrapper around OpenCV's "HighGUI" named windows. While OpenCV was designed for use in full-scale applications and can be used within functionally rich UI frameworks (such as Qt*, WinForms*, or Cocoa*) or without any UI at all, sometimes there it is required to try functionality quickly and visualize the results. This is what the HighGUI module has been designed for.
For further details, please see: http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html
func NewWindow ¶
NewWindow creates a new named OpenCV window
For further details, please see: http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b
func (*Window) Close ¶
Close closes and deletes a named OpenCV Window.
For further details, please see: http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga851ccdd6961022d1d5b4c4f255dbab34
func (*Window) CreateTrackbar ¶ added in v0.3.0
CreateTrackbar creates a trackbar and attaches it to the specified window.
For further details, please see: https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#gaf78d2155d30b728fc413803745b67a9b
func (*Window) IMShow ¶
IMShow displays an image Mat in the specified window. This function should be followed by the WaitKey function which displays the image for specified milliseconds. Otherwise, it won't display the image.
For further details, please see: http://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563
func (*Window) SetWindowProperty ¶ added in v0.4.1
func (w *Window) SetWindowProperty(flag WindowPropertyFlag, value WindowFlag)
SetWindowProperty changes parameters of a window dynamically.
For further details, please see: https://docs.opencv.org/3.3.1/d7/dfc/group__highgui.html#ga66e4a6db4d4e06148bcdfe0d70a5df27
type WindowFlag ¶ added in v0.4.1
type WindowFlag float32
WindowFlag value for SetWindowProperty / GetWindowProperty.
type WindowPropertyFlag ¶ added in v0.4.1
type WindowPropertyFlag int
WindowPropertyFlag flags for SetWindowProperty / GetWindowProperty.