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/master/d1/dfb/intro.html
Index ¶
- Constants
- Variables
- func AbsDiff(src1, src2 Mat, dst *Mat)
- func AdaptiveThreshold(src Mat, dst *Mat, maxValue float32, adaptiveTyp AdaptiveThresholdType, ...)
- func Add(src1, src2 Mat, dst *Mat)
- func AddWeighted(src1 Mat, alpha float64, src2 Mat, beta float64, gamma float64, dst *Mat)
- func ApplyColorMap(src Mat, dst *Mat, colormapType ColormapTypes)
- func ApplyCustomColorMap(src Mat, dst *Mat, customColormap Mat)
- func ApproxPolyDP(curve []image.Point, epsilon float64, closed bool) (approxCurve []image.Point)
- func ArcLength(curve []image.Point, isClosed bool) float64
- func ArrowedLine(img *Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int)
- func BatchDistance(src1 Mat, src2 Mat, dist Mat, dtype int, nidx Mat, normType int, K int, ...)
- func BilateralFilter(src Mat, dst *Mat, diameter 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 BorderInterpolate(p int, len int, borderType CovarFlags) int
- func BoundingRect(contour []image.Point) image.Rectangle
- func BoxFilter(src Mat, dst *Mat, depth int, ksize image.Point)
- func CalcCovarMatrix(samples Mat, covar *Mat, mean *Mat, flags CovarFlags, ctype int)
- func CalcHist(src []Mat, channels []int, mask Mat, hist *Mat, size []int, ranges []float64, ...)
- 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 CartToPolar(x Mat, y Mat, magnitude *Mat, angle *Mat, angleInDegrees bool)
- func CheckRange(src Mat) bool
- func Circle(img *Mat, center image.Point, radius int, c color.RGBA, thickness int)
- func Compare(src1 Mat, src2 Mat, dst *Mat, ct CompareType)
- func CompleteSymm(m Mat, lowerToUpper bool)
- func ContourArea(contour []image.Point) float64
- func ConvertScaleAbs(src Mat, dst *Mat, alpha float64, beta float64)
- func ConvexHull(points []image.Point, hull *Mat, clockwise bool, returnPoints bool)
- func ConvexityDefects(contour []image.Point, hull Mat, result *Mat)
- func CopyMakeBorder(src Mat, dst *Mat, top int, bottom int, left int, right int, bt BorderType, ...)
- func CornerSubPix(img Mat, corners *Mat, winSize image.Point, zeroZone image.Point, ...)
- func CountNonZero(src Mat) int
- func CvtColor(src Mat, dst *Mat, code ColorConversionCode)
- func DCT(src Mat, dst *Mat, flags DftFlags)
- func DFT(src Mat, dst *Mat, flags DftFlags)
- func Determinant(src Mat) float64
- func Dilate(src Mat, dst *Mat, kernel Mat)
- func Divide(src1 Mat, src2 Mat, dst *Mat)
- func DrawContours(img *Mat, contours [][]image.Point, contourIdx int, c color.RGBA, ...)
- func DrawKeyPoints(src Mat, keyPoints []KeyPoint, dst *Mat, color color.RGBA, ...)
- func Eigen(src Mat, eigenvalues *Mat, eigenvectors *Mat) bool
- func EigenNonSymmetric(src Mat, eigenvalues *Mat, eigenvectors *Mat)
- func Ellipse(img *Mat, center, axes image.Point, angle, startAngle, endAngle float64, ...)
- func EqualizeHist(src Mat, dst *Mat)
- func Erode(src Mat, dst *Mat, kernel Mat)
- func Exp(src Mat, dst *Mat)
- func ExtractChannel(src Mat, dst *Mat, coi int)
- func FP16BlobFromImage(img Mat, scaleFactor float32, size image.Point, mean float32, swapRB bool, ...) []byte
- func FillPoly(img *Mat, pts [][]image.Point, c color.RGBA)
- func Filter2D(src Mat, dst *Mat, ddepth int, kernel Mat, anchor image.Point, delta float64, ...)
- func FindContours(src Mat, mode RetrievalMode, method ContourApproximationMode) [][]image.Point
- func FindNonZero(src Mat, idx *Mat)
- func FisheyeUndistortImage(distorted Mat, undistorted *Mat, k, d Mat)
- func FisheyeUndistortImageWithParams(distorted Mat, undistorted *Mat, k, d, knew Mat, size image.Point)
- func FitLine(pts []image.Point, line *Mat, distType DistanceTypes, ...)
- func Flip(src Mat, dst *Mat, flipCode int)
- func GaussianBlur(src Mat, dst *Mat, ksize image.Point, sigmaX float64, sigmaY float64, ...)
- func Gemm(src1, src2 Mat, alpha float64, src3 Mat, beta float64, dst *Mat, flags int)
- func GetOptimalDFTSize(vecsize int) int
- func GetTextSize(text string, fontFace HersheyFont, fontScale float64, thickness int) image.Point
- func GetTickCount() float64
- func GetTickFrequency() float64
- func GoodFeaturesToTrack(img Mat, corners *Mat, maxCorners int, quality float64, minDist float64)
- func GroupRectangles(rects []image.Rectangle, groupThreshold int, eps float64) []image.Rectangle
- func Hconcat(src1, src2 Mat, dst *Mat)
- func HoughCircles(src Mat, circles *Mat, method HoughMode, dp, minDist float64)
- func HoughCirclesWithParams(src Mat, circles *Mat, method HoughMode, dp, minDist, param1, param2 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 HoughLinesPWithParams(src Mat, lines *Mat, rho float32, theta float32, threshold int, ...)
- func IDCT(src Mat, dst *Mat, flags int)
- func IDFT(src Mat, dst *Mat, flags, nonzeroRows int)
- func IMEncode(fileExt FileExt, img Mat) (buf []byte, err error)
- func IMEncodeWithParams(fileExt FileExt, img Mat, params []int) (buf []byte, err error)
- func IMWrite(name string, img Mat) bool
- func IMWriteWithParams(name string, img Mat, params []int) bool
- func InRange(src, lb, ub Mat, dst *Mat)
- func InRangeWithScalar(src Mat, lb, ub Scalar, dst *Mat)
- func InsertChannel(src Mat, dst *Mat, coi int)
- func Invert(src Mat, dst *Mat, flags int) float64
- func LUT(src, wbLUT Mat, dst *Mat)
- func Laplacian(src Mat, dst *Mat, dDepth int, size int, scale float64, delta float64, ...)
- func Line(img *Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int)
- func Log(src Mat, dst *Mat)
- func LogPolar(src Mat, dst *Mat, center image.Point, m float64, flags InterpolationFlags)
- func Magnitude(x, y Mat, magnitude *Mat)
- func MatchTemplate(image Mat, templ Mat, result *Mat, method TemplateMatchMode, mask Mat)
- func Max(src1, src2 Mat, dst *Mat)
- func MeanStdDev(src Mat, dst *Mat, dstStdDev *Mat)
- func MedianBlur(src Mat, dst *Mat, ksize int)
- func Merge(mv []Mat, dst *Mat)
- func Min(src1, src2 Mat, dst *Mat)
- func MinMaxIdx(input Mat) (minVal, maxVal float32, minIdx, maxIdx int)
- func MinMaxLoc(input Mat) (minVal, maxVal float32, minLoc, maxLoc image.Point)
- func Moments(src Mat, binaryImage bool) map[string]float64
- func MorphologyEx(src Mat, dst *Mat, op MorphType, kernel Mat)
- func MulSpectrums(a Mat, b Mat, dst *Mat, flags DftFlags)
- func Multiply(src1 Mat, src2 Mat, dst *Mat)
- func Norm(src1 Mat, normType NormType) float64
- func Normalize(src Mat, dst *Mat, alpha float64, beta float64, typ NormType)
- func OpenCVVersion() string
- func PerspectiveTransform(src Mat, dst *Mat, tm Mat)
- func Phase(x, y Mat, angle *Mat, angleInDegrees bool)
- func PolarToCart(magnitude Mat, degree Mat, x *Mat, y *Mat, angleInDegrees bool)
- func Pow(src Mat, power float64, dst *Mat)
- func PutText(img *Mat, text string, org image.Point, fontFace HersheyFont, ...)
- func PyrDown(src Mat, dst *Mat, ksize image.Point, borderType BorderType)
- func PyrUp(src Mat, dst *Mat, ksize image.Point, borderType BorderType)
- func Rectangle(img *Mat, r image.Rectangle, c color.RGBA, thickness int)
- func Reduce(src Mat, dst *Mat, dim int, rType ReduceTypes, dType int)
- func Remap(src Mat, dst, map1, map2 *Mat, interpolation InterpolationFlags, ...)
- func Repeat(src Mat, nY int, nX int, dst *Mat)
- func Resize(src Mat, dst *Mat, sz image.Point, fx, fy float64, interp InterpolationFlags)
- func Rotate(src Mat, dst *Mat, code RotateFlag)
- func ScaleAdd(src1 Mat, alpha float64, src2 Mat, dst *Mat)
- func Scharr(src Mat, dst *Mat, dDepth int, dx int, dy int, scale float64, delta float64, ...)
- func SelectROI(name string, img Mat) image.Rectangle
- func SelectROIs(name string, img Mat) []image.Rectangle
- func SepFilter2D(src Mat, dst *Mat, ddepth int, kernelX, kernelY Mat, anchor image.Point, ...)
- func Sobel(src Mat, dst *Mat, ddepth, dx, dy, ksize int, scale, delta float64, ...)
- func Solve(src1 Mat, src2 Mat, dst *Mat, flags SolveDecompositionFlags) bool
- func SolveCubic(coeffs Mat, roots *Mat) int
- func SolvePoly(coeffs Mat, roots *Mat, maxIters int) float64
- func Sort(src Mat, dst *Mat, flags SortFlags)
- func SortIdx(src Mat, dst *Mat, flags SortFlags)
- func SpatialGradient(src Mat, dx, dy *Mat, ksize int, borderType BorderType)
- func SqBoxFilter(src Mat, dst *Mat, depth int, ksize image.Point)
- func Subtract(src1 Mat, src2 Mat, dst *Mat)
- func Threshold(src Mat, dst *Mat, thresh float32, maxvalue float32, typ ThresholdType)
- func Transform(src Mat, dst *Mat, tm Mat)
- func Transpose(src Mat, dst *Mat)
- func Vconcat(src1, src2 Mat, dst *Mat)
- func Version() string
- func WaitKey(delay int) int
- func WarpAffine(src Mat, dst *Mat, m Mat, sz image.Point)
- func WarpAffineWithParams(src Mat, dst *Mat, m Mat, sz image.Point, flags InterpolationFlags, ...)
- func WarpPerspective(src Mat, dst *Mat, m Mat, sz image.Point)
- type AKAZE
- type AdaptiveThresholdType
- type AgastFeatureDetector
- type BFMatcher
- type BRISK
- type BackgroundSubtractorKNN
- type BackgroundSubtractorMOG2
- type BorderType
- type CalibFlag
- 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 ColormapTypes
- type CompareType
- type ContourApproximationMode
- type CovarFlags
- type DMatch
- type DftFlags
- type DistanceTypes
- type DrawMatchesFlag
- type FastFeatureDetector
- type FileExt
- type GFTTDetector
- type HOGDescriptor
- type HersheyFont
- type HoughMode
- type IMReadFlag
- type InterpolationFlags
- type KAZE
- type KeyPoint
- type Layer
- type MSER
- type Mat
- func BlobFromImage(img Mat, scaleFactor float64, size image.Point, mean Scalar, swapRB bool, ...) Mat
- func GetBlobChannel(blob Mat, imgidx int, chnidx int) Mat
- func GetPerspectiveTransform(src, dst []image.Point) Mat
- func GetRotationMatrix2D(center image.Point, angle, scale float64) Mat
- func GetStructuringElement(shape MorphShape, ksize image.Point) Mat
- func HOGDefaultPeopleDetector() Mat
- func IMDecode(buf []byte, flags IMReadFlag) (Mat, error)
- func IMRead(name string, flags IMReadFlag) Mat
- func ImageGrayToMatGray(img *image.Gray) (Mat, error)
- func ImageToMatRGB(img image.Image) (Mat, error)
- func ImageToMatRGBA(img image.Image) (Mat, error)
- func NewMat() Mat
- func NewMatFromBytes(rows int, cols int, mt MatType, data []byte) (Mat, error)
- func NewMatFromScalar(s Scalar, mt MatType) Mat
- func NewMatWithSize(rows int, cols int, mt MatType) Mat
- func NewMatWithSizeFromScalar(s Scalar, rows int, cols int, mt MatType) Mat
- func Split(src Mat) (mv []Mat)
- func (m *Mat) AddFloat(val float32)
- func (m *Mat) AddUChar(val uint8)
- func (m *Mat) Channels() int
- func (m *Mat) Clone() Mat
- func (m *Mat) Close() error
- func (m *Mat) Cols() int
- func (m *Mat) ConvertFp16() Mat
- func (m *Mat) ConvertTo(dst *Mat, mt MatType)
- func (m *Mat) CopyTo(dst *Mat)
- func (m *Mat) CopyToWithMask(dst *Mat, mask Mat)
- func (m *Mat) DataPtrFloat32() ([]float32, error)
- func (m *Mat) DataPtrFloat64() ([]float64, error)
- func (m *Mat) DataPtrInt16() ([]int16, error)
- func (m *Mat) DataPtrInt8() []int8
- func (m *Mat) DataPtrUint16() ([]uint16, error)
- func (m *Mat) DataPtrUint8() []uint8
- func (m *Mat) DivideFloat(val float32)
- func (m *Mat) DivideUChar(val uint8)
- func (m *Mat) Empty() bool
- func (m *Mat) FromPtr(rows int, cols int, mt MatType, prow int, pcol int) (Mat, error)
- func (m *Mat) GetDoubleAt(row int, col int) float64
- func (m *Mat) GetDoubleAt3(x, y, z int) float64
- func (m *Mat) GetFloatAt(row int, col int) float32
- func (m *Mat) GetFloatAt3(x, y, z int) float32
- func (m *Mat) GetIntAt(row int, col int) int32
- func (m *Mat) GetIntAt3(x, y, z int) int32
- func (m *Mat) GetSCharAt(row int, col int) int8
- func (m *Mat) GetSCharAt3(x, y, z int) int8
- func (m *Mat) GetShortAt(row int, col int) int16
- func (m *Mat) GetShortAt3(x, y, z int) int16
- func (m *Mat) GetUCharAt(row int, col int) uint8
- func (m *Mat) GetUCharAt3(x, y, z int) uint8
- func (m *Mat) GetVecfAt(row int, col int) Vecf
- func (m *Mat) GetVeciAt(row int, col int) Veci
- func (m *Mat) Mean() Scalar
- func (m *Mat) MultiplyFloat(val float32)
- func (m *Mat) MultiplyUChar(val uint8)
- func (m *Mat) PatchNaNs()
- func (m *Mat) Ptr() C.Mat
- func (m *Mat) Region(rio image.Rectangle) Mat
- func (m *Mat) Reshape(cn int, rows int) Mat
- func (m *Mat) Rows() int
- func (m *Mat) SetDoubleAt(row int, col int, val float64)
- func (m *Mat) SetDoubleAt3(x, y, z int, val float64)
- func (m *Mat) SetFloatAt(row int, col int, val float32)
- func (m *Mat) SetFloatAt3(x, y, z int, val float32)
- func (m *Mat) SetIntAt(row int, col int, val int32)
- func (m *Mat) SetIntAt3(x, y, z int, val int32)
- func (m *Mat) SetSCharAt(row int, col int, val int8)
- func (m *Mat) SetSCharAt3(x, y, z int, val int8)
- func (m *Mat) SetShortAt(row int, col int, val int16)
- func (m *Mat) SetShortAt3(x, y, z int, val int16)
- func (m *Mat) SetTo(s Scalar)
- func (m *Mat) SetUCharAt(row int, col int, val uint8)
- func (m *Mat) SetUCharAt3(x, y, z int, val uint8)
- func (m *Mat) Size() (dims []int)
- func (m *Mat) Sqrt() Mat
- func (m *Mat) Step() int
- func (m *Mat) SubtractFloat(val float32)
- func (m *Mat) SubtractUChar(val uint8)
- func (m *Mat) Sum() Scalar
- func (m *Mat) ToBytes() []byte
- func (m *Mat) ToImage() (image.Image, error)
- func (m *Mat) Total() int
- func (m *Mat) Type() MatType
- type MatType
- type MorphShape
- type MorphType
- type Net
- func (net *Net) Close() error
- func (net *Net) Empty() bool
- func (net *Net) Forward(outputName string) Mat
- func (net *Net) ForwardLayers(outBlobNames []string) (blobs []Mat)
- func (net *Net) GetLayer(layer int) Layer
- func (net *Net) GetPerfProfile() float64
- func (net *Net) GetUnconnectedOutLayers() (ids []int)
- func (net *Net) SetInput(blob Mat, name string)
- func (net *Net) SetPreferableBackend(backend NetBackendType) error
- func (net *Net) SetPreferableTarget(target NetTargetType) error
- type NetBackendType
- type NetTargetType
- type NormType
- type ORB
- type ReduceTypes
- type RetrievalMode
- type RotateFlag
- type RotatedRect
- type Scalar
- type SimpleBlobDetector
- type SolveDecompositionFlags
- type SortFlags
- type TemplateMatchMode
- type TermCriteria
- type TermCriteriaType
- type ThresholdType
- type Trackbar
- type Vecf
- type Veci
- type VideoCapture
- func (v *VideoCapture) Close() error
- func (v *VideoCapture) CodecString() string
- func (v VideoCapture) Get(prop VideoCaptureProperties) float64
- func (v *VideoCapture) Grab(skip int)
- func (v *VideoCapture) IsOpened() bool
- func (v *VideoCapture) Read(m *Mat) bool
- func (v *VideoCapture) Set(prop VideoCaptureProperties, param float64)
- type VideoCaptureProperties
- type VideoWriter
- type Window
- func (w *Window) Close() error
- func (w *Window) CreateTrackbar(name string, max int) *Trackbar
- func (w *Window) GetWindowProperty(flag WindowPropertyFlag) float64
- func (w *Window) IMShow(img Mat)
- func (w *Window) IsOpen() bool
- func (w *Window) MoveWindow(x, y int)
- func (w *Window) ResizeWindow(width, height int)
- func (w *Window) SetWindowProperty(flag WindowPropertyFlag, value WindowFlag)
- func (w *Window) SetWindowTitle(title string)
- func (w *Window) WaitKey(delay int) int
- type WindowFlag
- type WindowPropertyFlag
Examples ¶
Constants ¶
const ( // MatChannels1 is a single channel Mat. MatChannels1 = 0 // MatChannels2 is 2 channel Mat. MatChannels2 = 8 // MatChannels3 is 3 channel Mat. MatChannels3 = 16 // MatChannels4 is 4 channel Mat. MatChannels4 = 24 )
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 // MatTypeCV16SC2 is a Mat of 16-bit signed int with 2 channels MatTypeCV16SC2 = MatTypeCV16S + MatChannels2 // 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 // MatTypeCV8UC1 is a Mat of 8-bit unsigned int with a single channel MatTypeCV8UC1 = MatTypeCV8U + MatChannels1 // MatTypeCV8UC2 is a Mat of 8-bit unsigned int with 2 channels MatTypeCV8UC2 = MatTypeCV8U + MatChannels2 // MatTypeCV8UC3 is a Mat of 8-bit unsigned int with 3 channels MatTypeCV8UC3 = MatTypeCV8U + MatChannels3 // MatTypeCV8UC4 is a Mat of 8-bit unsigned int with 4 channels MatTypeCV8UC4 = MatTypeCV8U + MatChannels4 )
const ( // CompareEQ src1 is equal to src2. CompareEQ CompareType = 0 // CompareGT src1 is greater than src2. CompareGT = 1 // CompareGE src1 is greater than or equal to src2. CompareGE = 2 // CompareLT src1 is less than src2. CompareLT = 3 // CompareLE src1 is less than or equal to src2. CompareLE = 4 // CompareNE src1 is unequal to src2. CompareNE = 5 )
const ( // CovarScrambled indicates to scramble the results. CovarScrambled CovarFlags = 0 // CovarNormal indicates to use normal covariation. CovarNormal = 1 // CovarUseAvg indicates to use average covariation. CovarUseAvg = 2 // CovarScale indicates to use scaled covariation. CovarScale = 4 // CovarRows indicates to use covariation on rows. CovarRows = 8 // CovarCols indicates to use covariation on columns. CovarCols = 16 )
const ( // DftForward performs forward 1D or 2D dft or dct. DftForward DftFlags = 0 // DftInverse performs an inverse 1D or 2D transform. DftInverse = 1 // DftScale scales the result: divide it by the number of array elements. Normally, it is combined with DFT_INVERSE. DftScale = 2 // DftRows performs a forward or inverse transform of every individual row of the input matrix. DftRows = 4 // DftComplexOutput performs a forward transformation of 1D or 2D real array; the result, though being a complex array, has complex-conjugate symmetry DftComplexOutput = 16 // DftRealOutput performs an inverse transformation of a 1D or 2D complex array; the result is normally a complex array of the same size, // however, if the input array has conjugate-complex symmetry (for example, it is a result of forward transformation with DFT_COMPLEX_OUTPUT flag), // the output is a real array. DftRealOutput = 32 // DftComplexInput specifies that input is complex input. If this flag is set, the input must have 2 channels. DftComplexInput = 64 // DctInverse performs an inverse 1D or 2D dct transform. DctInverse = DftInverse // DctRows performs a forward or inverse dct transform of every individual row of the input matrix. DctRows = DftRows )
const ( // Rotate90Clockwise allows to rotate image 90 degrees clockwise Rotate90Clockwise RotateFlag = 0 // Rotate180Clockwise allows to rotate image 180 degrees clockwise Rotate180Clockwise = 1 // Rotate90CounterClockwise allows to rotate 270 degrees clockwise Rotate90CounterClockwise = 2 )
const ( // NormInf indicates use infinite normalization. NormInf NormType = 1 // NormL1 indicates use L1 normalization. NormL1 = 2 // NormL2 indicates use L2 normalization. NormL2 = 4 // NormL2Sqr indicates use L2 squared normalization. NormL2Sqr = 5 // NormHamming indicates use Hamming normalization. NormHamming = 6 // NormHamming2 indicates use Hamming 2-bit normalization. NormHamming2 = 7 // NormTypeMask indicates use type mask for normalization. NormTypeMask = 7 // NormRelative indicates use relative normalization. NormRelative = 8 // NormMinMax indicates use min/max normalization. NormMinMax = 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 ( // Gaussian elimination with the optimal pivot element chosen. SolveDecompositionLu = 0 // Singular value decomposition (SVD) method. The system can be over-defined and/or the matrix src1 can be singular. SolveDecompositionSvd = 1 // Eigenvalue decomposition. The matrix src1 must be symmetrical. SolveDecompositionEing = 2 // Cholesky LL^T factorization. The matrix src1 must be symmetrical and positively defined. SolveDecompositionCholesky = 3 // QR factorization. The system can be over-defined and/or the matrix src1 can be singular. SolveDecompositionQr = 4 // While all the previous flags are mutually exclusive, this flag can be used together with any of the previous. // It means that the normal equations 𝚜𝚛𝚌𝟷^T⋅𝚜𝚛𝚌𝟷⋅𝚍𝚜𝚝=𝚜𝚛𝚌𝟷^T𝚜𝚛𝚌𝟸 are solved instead of the original system // 𝚜𝚛𝚌𝟷⋅𝚍𝚜𝚝=𝚜𝚛𝚌𝟸. SolveDecompositionNormal = 5 )
const ( // DrawDefault creates new image and for each keypoint only the center point will be drawn DrawDefault DrawMatchesFlag = 0 // DrawOverOutImg draws matches on existing content of image DrawOverOutImg = 1 // NotDrawSinglePoints will not draw single points NotDrawSinglePoints = 2 // DrawRichKeyPoints draws the circle around each keypoint with keypoint size and orientation DrawRichKeyPoints = 3 )
const ( // WindowNormal indicates a normal window. WindowNormal WindowFlag = 0 // WindowFullscreen indicates a full-screen window. WindowFullscreen = 1 // WindowAutosize indicates a window sized based on the contents. WindowAutosize = 1 // WindowFreeRatio indicates allow the user to resize without maintaining aspect ratio. WindowFreeRatio = 0x00000100 // WindowKeepRatio indicates always maintain an aspect ratio that matches the contents. 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 //IMWriteJpegQuality is the quality from 0 to 100 for JPEG (the higher is the better). Default value is 95. IMWriteJpegQuality = 1 // IMWriteJpegProgressive enables JPEG progressive feature, 0 or 1, default is False. IMWriteJpegProgressive = 2 // IMWriteJpegOptimize enables JPEG optimization, 0 or 1, default is False. IMWriteJpegOptimize = 3 // IMWriteJpegRstInterval is the JPEG restart interval, 0 - 65535, default is 0 - no restart. IMWriteJpegRstInterval = 4 // IMWriteJpegLumaQuality separates luma quality level, 0 - 100, default is 0 - don't use. IMWriteJpegLumaQuality = 5 // IMWriteJpegChromaQuality separates chroma quality level, 0 - 100, default is 0 - don't use. IMWriteJpegChromaQuality = 6 // IMWritePngCompression is the compression level from 0 to 9 for PNG. 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 // IMWritePngStrategy is one of cv::IMWritePNGFlags, default is IMWRITE_PNG_STRATEGY_RLE. IMWritePngStrategy = 17 // IMWritePngBilevel is the binary level PNG, 0 or 1, default is 0. IMWritePngBilevel = 18 // IMWritePxmBinary for PPM, PGM, or PBM can be a binary format flag, 0 or 1. Default value is 1. IMWritePxmBinary = 32 // IMWriteWebpQuality is the quality from 1 to 100 for WEBP (the higher is // the better). By default (without any parameter) and for quality above // 100 the lossless compression is used. IMWriteWebpQuality = 64 // IMWritePamTupletype sets the TUPLETYPE field to the corresponding string // value that is defined for the format. IMWritePamTupletype = 128 // IMWritePngStrategyDefault is the value to use for normal data. IMWritePngStrategyDefault = 0 // IMWritePngStrategyFiltered is the value to use 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 // IMWritePngStrategyHuffmanOnly forces Huffman encoding only (no string match). IMWritePngStrategyHuffmanOnly = 2 // IMWritePngStrategyRle is the value to use to limit match distances to // one (run-length encoding). IMWritePngStrategyRle = 3 // IMWritePngStrategyFixed is the value to prevent 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 ( // TmSqdiff maps to TM_SQDIFF TmSqdiff TemplateMatchMode = 0 // TmSqdiffNormed maps to TM_SQDIFF_NORMED TmSqdiffNormed = 1 // TmCcorr maps to TM_CCORR TmCcorr = 2 // TmCcorrNormed maps to TM_CCORR_NORMED TmCcorrNormed = 3 // TmCcoeff maps to TM_CCOEFF TmCcoeff = 4 // TmCcoeffNormed maps to TM_CCOEFF_NORMED TmCcoeffNormed = 5 )
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 ( // HoughStandard is the classical or standard Hough transform. HoughStandard HoughMode = 0 // HoughProbabilistic is the probabilistic Hough transform (more efficient // in case if the picture contains a few long linear segments). HoughProbabilistic = 1 // HoughMultiScale is the multi-scale variant of the classical Hough // transform. HoughMultiScale = 2 // HoughGradient is basically 21HT, described in: HK Yuen, John Princen, // John Illingworth, and Josef Kittler. Comparative study of hough // transform methods for circle finding. Image and Vision Computing, // 8(1):71–77, 1990. HoughGradient = 3 )
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 // InterpolationMax indicates use maximum interpolation. InterpolationMax = 7 )
const ( ColormapAutumn ColormapTypes = 0 ColormapBone = 1 ColormapJet = 2 ColormapWinter = 3 ColormapRainbow = 4 ColormapOcean = 5 ColormapSummer = 6 ColormapSpring = 7 ColormapCool = 8 ColormapHsv = 9 ColormapPink = 10 ColormapHot = 11 ColormapParula = 12 )
List of the available color maps
For further details, please see: https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#ga9a805d8262bcbe273f16be9ea2055a65
const ( DistUser DistanceTypes = 0 DistL1 = 1 DistL2 = 2 DistC = 3 DistL12 = 4 DistFair = 5 DistWelsch = 6 DistHuber = 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.18.0"
GoCVVersion of this package, for display purposes.
Variables ¶
var ErrEmptyByteSlice = errors.New("empty byte array")
Functions ¶
func AbsDiff ¶
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/master/d2/de8/group__core__array.html#ga6fef31bc8c4071cbc114a758a2b79c14
func AdaptiveThreshold ¶
func AdaptiveThreshold(src Mat, dst *Mat, maxValue float32, adaptiveTyp AdaptiveThresholdType, typ ThresholdType, blockSize int, c float32)
AdaptiveThreshold applies a fixed-level threshold to each array element.
For further details, please see: https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga72b913f352e4a1b1b397736707afcde3
func Add ¶
Add calculates the per-element sum of two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga10ac1bfb180e2cfda1701d06c24fdbd6
func AddWeighted ¶
AddWeighted calculates the weighted sum of two arrays.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gafafb2513349db3bcff51f54ee5592a19
func ApplyColorMap ¶
func ApplyColorMap(src Mat, dst *Mat, colormapType ColormapTypes)
ApplyColorMap applies a GNU Octave/MATLAB equivalent colormap on a given image.
For further details, please see: https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#gadf478a5e5ff49d8aa24e726ea6f65d15
func ApplyCustomColorMap ¶
ApplyCustomColorMap applies a custom defined colormap on a given image.
For further details, please see: https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#gacb22288ddccc55f9bd9e6d492b409cae
func ApproxPolyDP ¶
ApproxPolyDP approximates a polygonal curve(s) with the specified precision.
For further details, please see:
https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga0012a5fdaea70b8a9970165d98722b4c
func ArcLength ¶
ArcLength calculates a contour perimeter or a curve length.
For further details, please see:
https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga8d26483c636be6b35c3ec6335798a47c
func ArrowedLine ¶
ArrowedLine draws a arrow segment pointing from the first point to the second one.
For further details, please see: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga0a165a3ca093fd488ac709fdf10c05b2
func BatchDistance ¶
func BatchDistance(src1 Mat, src2 Mat, dist Mat, dtype int, nidx Mat, normType int, K int, mask Mat, update int, crosscheck bool)
BatchDistance is a naive nearest neighbor finder.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga4ba778a1c57f83233b1d851c83f5a622
func BilateralFilter ¶
BilateralFilter applies a bilateral filter to an image.
Bilateral filtering is described here: 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/master/d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed
func BitwiseAnd ¶
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/master/d2/de8/group__core__array.html#ga60b4d04b251ba5eb1392c34425497e14
func BitwiseNot ¶
BitwiseNot inverts every bit of an array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga0002cf8b418479f4cb49a75442baee2f
func BitwiseOr ¶
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/master/d2/de8/group__core__array.html#gab85523db362a4e26ff0c703793a719b4
func BitwiseXor ¶
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/master/d2/de8/group__core__array.html#ga84b2d8188ce506593dcc3f8cd00e8e2c
func Blur ¶
Blur blurs an image Mat using a normalized box filter.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37
func BorderInterpolate ¶
func BorderInterpolate(p int, len int, borderType CovarFlags) int
BorderInterpolate computes the source location of an extrapolated pixel.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga247f571aa6244827d3d798f13892da58
func BoundingRect ¶
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 BoxFilter ¶
BoxFilter blurs an image using the box filter.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3
func CalcCovarMatrix ¶
func CalcCovarMatrix(samples Mat, covar *Mat, mean *Mat, flags CovarFlags, ctype int)
CalcCovarMatrix calculates the covariance matrix of a set of vectors.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga017122d912af19d7d0d2cccc2d63819f
func CalcHist ¶
func CalcHist(src []Mat, channels []int, mask Mat, hist *Mat, size []int, ranges []float64, acc bool)
CalcHist Calculates a histogram of a set of images
For futher details, please see: https://docs.opencv.org/master/d6/dc7/group__imgproc__hist.html#ga6ca1876785483836f72a77ced8ea759a
func CalcOpticalFlowFarneback ¶
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/master/dc/d6b/group__video__track.html#ga5d10ebbd59fe09c5f650289ec0ece5af
func CalcOpticalFlowPyrLK ¶
func CalcOpticalFlowPyrLK(prevImg Mat, nextImg Mat, prevPts Mat, nextPts Mat, status *Mat, err *Mat)
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/master/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/master/dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de
func CartToPolar ¶
CartToPolar calculates the magnitude and angle of 2D vectors.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gac5f92f48ec32cacf5275969c33ee837d
func CheckRange ¶
CheckRange checks every element of an input array for invalid values.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga2bd19d89cae59361416736f87e3c7a64
func Circle ¶
Circle draws a circle.
For further details, please see: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670
func Compare ¶
func Compare(src1 Mat, src2 Mat, dst *Mat, ct CompareType)
Compare performs the per-element comparison of two arrays or an array and scalar value.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga303cfb72acf8cbb36d884650c09a3a97
func CompleteSymm ¶
CompleteSymm copies the lower or the upper half of a square matrix to its another half.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa9d88dcd0e54b6d1af38d41f2a3e3d25
func ContourArea ¶
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 ConvertScaleAbs ¶
ConvertScaleAbs scales, calculates absolute values, and converts the result to 8-bit.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga3460e9c9f37b563ab9dd550c4d8c4e7d
func ConvexHull ¶
ConvexHull finds the convex hull of a point set.
For further details, please see: https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga014b28e56cb8854c0de4a211cb2be656
func ConvexityDefects ¶
ConvexityDefects finds the convexity defects of a contour.
For further details, please see: https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gada4437098113fd8683c932e0567f47ba
func CopyMakeBorder ¶
func CopyMakeBorder(src Mat, dst *Mat, top int, bottom int, left int, right int, bt BorderType, value color.RGBA)
CopyMakeBorder forms a border around an image (applies padding).
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga2ac1049c2c3dd25c2b41bffe17658a36
func CornerSubPix ¶
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/master/dd/d1a/group__imgproc__feature.html#ga354e0d7c86d0d9da75de9b9701a9a87e
func CountNonZero ¶
CountNonZero counts non-zero array elements.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa4b89393263bb4d604e0fe5986723914
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/master/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
func DCT ¶
DCT performs a forward or inverse discrete Cosine transform of 1D or 2D array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga85aad4d668c01fbd64825f589e3696d4
func DFT ¶
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/master/d2/de8/group__core__array.html#gadd6cf9baf2b8b704a11b5f04aaf4f39d
func Determinant ¶
Determinant returns the determinant of a square floating-point matrix.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaf802bd9ca3e07b8b6170645ef0611d0c
func Dilate ¶
Dilate dilates an image by using a specific structuring element.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c
func Divide ¶
Divide performs the per-element division on two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6db555d30115642fedae0cda05604874
func DrawContours ¶
DrawContours draws contours outlines or filled contours.
For further details, please see: https://docs.opencv.org/3.3.1/d6/d6e/group__imgproc__draw.html#ga746c0625f1781f1ffc9056259103edbc
func DrawKeyPoints ¶
DrawKeypPints draws keypoints
For further details please see: https://docs.opencv.org/master/d4/d5d/group__features2d__draw.html#gab958f8900dd10f14316521c149a60433
func Eigen ¶
Eigen calculates eigenvalues and eigenvectors of a symmetric matrix.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9fa0d58657f60eaa6c71f6fbb40456e3
func EigenNonSymmetric ¶
EigenNonSymmetric calculates eigenvalues and eigenvectors of a non-symmetric matrix (real eigenvalues only).
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaf51987e03cac8d171fbd2b327cf966f6
func Ellipse ¶
func Ellipse(img *Mat, center, axes image.Point, angle, startAngle, endAngle float64, c color.RGBA, thickness int)
Ellipse draws a simple or thick elliptic arc or fills an ellipse sector.
For further details, please see: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga28b2267d35786f5f890ca167236cbc69
func EqualizeHist ¶
EqualizeHist normalizes the brightness and increases the contrast of the image.
For further details, please see: https://docs.opencv.org/master/d6/dc7/group__imgproc__hist.html#ga7e54091f0c937d49bf84152a16f76d6e
func Erode ¶
Erode erodes an image by using a specific structuring element.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb
func Exp ¶
Exp calculates the exponent of every array element.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga3e10108e2162c338f1b848af619f39e5
func ExtractChannel ¶
ExtractChannel extracts a single channel from src (coi is 0-based index).
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gacc6158574aa1f0281878c955bcf35642
func FP16BlobFromImage ¶
func FP16BlobFromImage(img Mat, scaleFactor float32, size image.Point, mean float32, swapRB bool, crop bool) []byte
FP16BlobFromImage is an extended helper function to convert an Image to a half-float blob, as used by the Movidius Neural Compute Stick.
func FillPoly ¶
FillPoly fills the area bounded by one or more polygons.
For more information, see: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf30888828337aa4c6b56782b5dfbd4b7
func Filter2D ¶
func Filter2D(src Mat, dst *Mat, ddepth int, kernel Mat, anchor image.Point, delta float64, borderType BorderType)
Filter2D applies an arbitrary linear filter to an image.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04
func FindContours ¶
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 FindNonZero ¶
FindNonZero returns the list of locations of non-zero pixels.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaed7df59a3539b4cc0fe5c9c8d7586190
func FisheyeUndistortImage ¶
FisheyeUndistortImage transforms an image to compensate for fisheye lens distortion
func FisheyeUndistortImageWithParams ¶
func FisheyeUndistortImageWithParams(distorted Mat, undistorted *Mat, k, d, knew Mat, size image.Point)
FisheyeUndistortImageWithParams transforms an image to compensate for fisheye lens distortion with Knew matrix
func FitLine ¶
func FitLine(pts []image.Point, line *Mat, distType DistanceTypes, param, reps, aeps float64)
FitLine fits a line to a 2D or 3D point set.
For further details, please see: https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gaf849da1fdafa67ee84b1e9a23b93f91f
func Flip ¶
Flip flips a 2D array around horizontal(0), vertical(1), or both axes(-1).
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaca7be533e3dac7feb70fc60635adf441
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/master/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1
func Gemm ¶
Gemm performs generalized matrix multiplication.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gacb6e64071dffe36434e1e7ee79e7cb35
func GetOptimalDFTSize ¶
GetOptimalDFTSize returns the optimal Discrete Fourier Transform (DFT) size for a given vector size.
For further details, please see: https://docs.opencv.org/master/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/master/d6/d6e/group__imgproc__draw.html#ga3d2abfcb995fd2db908c8288199dba82
func GetTickCount ¶
func GetTickCount() float64
GetTickCount returns the number of ticks.
For further details, please see: https://docs.opencv.org/master/db/de0/group__core__utils.html#gae73f58000611a1af25dd36d496bf4487
func GetTickFrequency ¶
func GetTickFrequency() float64
GetTickFrequency returns the number of ticks per second.
For further details, please see: https://docs.opencv.org/master/db/de0/group__core__utils.html#ga705441a9ef01f47acdc55d87fbe5090c
func GoodFeaturesToTrack ¶
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/master/dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541
func GroupRectangles ¶
GroupRectangles groups the object candidate rectangles.
For further details, please see: https://docs.opencv.org/master/d5/d54/group__objdetect.html#ga3dba897ade8aa8227edda66508e16ab9
func Hconcat ¶
Hconcat applies horizontal concatenation to given matrices.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaab5ceee39e0580f879df645a872c6bf7
func HoughCircles ¶
HoughCircles finds circles in a grayscale image using the Hough transform. The only "method" currently supported is HoughGradient. If you want to pass more parameters, please see `HoughCirclesWithParams`.
For further details, please see: https://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d
func HoughCirclesWithParams ¶
func HoughCirclesWithParams(src Mat, circles *Mat, method HoughMode, dp, minDist, param1, param2 float64, minRadius, maxRadius int)
HoughCirclesWithParams finds circles in a grayscale image using the Hough transform. The only "method" currently supported is HoughGradient.
For further details, please see: https://docs.opencv.org/master/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/master/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/master/dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb
func HoughLinesPWithParams ¶
func IDCT ¶
IDCT calculates the inverse Discrete Cosine Transform of a 1D or 2D array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga77b168d84e564c50228b69730a227ef2
func IDFT ¶
IDFT calculates the inverse Discrete Fourier Transform of a 1D or 2D array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa708aa2d2e57a508f968eb0f69aa5ff1
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/master/d4/da8/group__imgcodecs.html#ga461f9ac09887e47797a54567df3b8b63
func IMEncodeWithParams ¶
IMEncodeWithParams 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.
Usage example:
buffer, err := gocv.IMEncodeWithParams(gocv.JPEGFileExt, img, []int{gocv.IMWriteJpegQuality, quality})
For further details, please see: http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga461f9ac09887e47797a54567df3b8b63
Example ¶
img := IMRead(path.Join(os.Getenv("GOPATH"), "src/gocv.io/x/gocv/images/face-detect.jpg"), IMReadColor) if img.Empty() { log.Fatal("Invalid Mat") } imgHandler := func(w http.ResponseWriter, req *http.Request) { quality := 75 if q, err := strconv.Atoi(req.URL.Query().Get("q")); err == nil { quality = q } buffer, err := IMEncodeWithParams(JPEGFileExt, img, []int{IMWriteJpegQuality, quality}) if err != nil { w.WriteHeader(http.StatusInternalServerError) io.WriteString(w, err.Error()) return } w.Header().Set("Content-Type", "image/jpeg") w.WriteHeader(http.StatusOK) w.Write(buffer) } http.HandleFunc("/img", imgHandler) fmt.Println("Open in browser http://127.0.0.1:8080/img?q=10 where q is a JPEG quality parameter") log.Fatal(http.ListenAndServe("127.0.0.1:8080", nil))
Output:
func IMWrite ¶
IMWrite writes a Mat to an image file.
For further details, please see: http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce
func IMWriteWithParams ¶
IMWriteWithParams writes a Mat to an image file. With that func you can pass compression parameters.
For further details, please see: http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce
func InRange ¶
InRange checks if array elements lie between the elements of two Mat arrays.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981
func InRangeWithScalar ¶
InRangeWithScalar checks if array elements lie between the elements of two Scalars
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981
func InsertChannel ¶
InsertChannel inserts a single channel to dst (coi is 0-based index) (it replaces channel i with another in dst).
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga1d4bd886d35b00ec0b764cb4ce6eb515
func Invert ¶
Invert finds the inverse or pseudo-inverse of a matrix.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gad278044679d4ecf20f7622cc151aaaa2
func LUT ¶
LUT performs a look-up table transform of an array.
The function LUT fills the output array with values from the look-up table. Indices of the entries are taken from the input array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gab55b8d062b7f5587720ede032d34156f
func Laplacian ¶
func Laplacian(src Mat, dst *Mat, dDepth int, size int, scale float64, delta float64, borderType BorderType)
Laplacian calculates the Laplacian of an image.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6
func Line ¶
Line draws a line segment connecting two points.
For further details, please see: https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2
func Log ¶
Log calculates the natural logarithm of every array element.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga937ecdce4679a77168730830a955bea7
func LogPolar ¶
LogPolar remaps an image to semilog-polar coordinates space.
For further details, please see: https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaec3a0b126a85b5ca2c667b16e0ae022d
func Magnitude ¶
Magnitude calculates the magnitude of 2D vectors.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6d3b097586bca4409873d64a90fe64c3
func MatchTemplate ¶
func MatchTemplate(image Mat, templ Mat, result *Mat, method TemplateMatchMode, mask Mat)
MatchTemplate compares a template against overlapped image regions.
For further details, please see: https://docs.opencv.org/master/df/dfb/group__imgproc__object.html#ga586ebfb0a7fb604b35a23d85391329be
func Max ¶
Max calculates per-element maximum of two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gacc40fa15eac0fb83f8ca70b7cc0b588d
func MeanStdDev ¶
MeanStdDev calculates a mean and standard deviation of array elements.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga846c858f4004d59493d7c6a4354b301d
func MedianBlur ¶
MedianBlur blurs an image using the median filter.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9
func Merge ¶
Merge creates one multi-channel array out of several single-channel ones.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga7d7b4d6c6ee504b30a20b1680029c7b4
func Min ¶
Min calculates per-element minimum of two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9af368f182ee76d0463d0d8d5330b764
func MinMaxIdx ¶
MinMaxIdx finds the global minimum and maximum in an array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga7622c466c628a75d9ed008b42250a73f
func MinMaxLoc ¶
MinMaxLoc finds the global minimum and maximum in an array.
For further details, please see: https://docs.opencv.org/trunk/d2/de8/group__core__array.html#gab473bf2eb6d14ff97e89b355dac20707
func Moments ¶
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/master/d3/dc0/group__imgproc__shape.html#ga556a180f43cab22649c23ada36a8a139
func MorphologyEx ¶
MorphologyEx performs advanced morphological transformations.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f
func MulSpectrums ¶
Mulspectrums performs the per-element multiplication of two Fourier spectrums.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga3ab38646463c59bf0ce962a9d51db64f
func Multiply ¶
Multiply calculates the per-element scaled product of two arrays. Both input arrays must be of the same size and the same type.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga979d898a58d7f61c53003e162e7ad89f
func Norm ¶
Norm calculates the absolute norm of an array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga7c331fb8dd951707e184ef4e3f21dd33
func Normalize ¶
Normalize normalizes the norm or value range of an array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga87eef7ee3970f86906d69a92cbf064bd
func OpenCVVersion ¶
func OpenCVVersion() string
OpenCVVersion returns the current OpenCV lib version
func PerspectiveTransform ¶
PerspectiveTransform performs the perspective matrix transformation of vectors.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gad327659ac03e5fd6894b90025e6900a7
func Phase ¶
Phase calculates the rotation angle of 2D vectors.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9db9ca9b4d81c3bde5677b8f64dc0137
func PolarToCart ¶
PolatToCart calculates x and y coordinates of 2D vectors from their magnitude and angle.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga581ff9d44201de2dd1b40a50db93d665
func Pow ¶
Pow raises every array element to a power.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaf0d056b5bd1dc92500d6f6cf6bac41ef
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/master/d6/d6e/group__imgproc__draw.html#ga5126f47f883d730f633d74f07456c576
func PyrDown ¶
func PyrDown(src Mat, dst *Mat, ksize image.Point, borderType BorderType)
PyrDown blurs an image and downsamples it.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaf9bba239dfca11654cb7f50f889fc2ff
func PyrUp ¶
func PyrUp(src Mat, dst *Mat, ksize image.Point, borderType BorderType)
PyrUp upsamples an image and then blurs it.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gada75b59bdaaca411ed6fee10085eb784
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/master/d6/d6e/group__imgproc__draw.html#ga346ac30b5c74e9b5137576c9ee9e0e8c
func Reduce ¶
func Reduce(src Mat, dst *Mat, dim int, rType ReduceTypes, dType int)
Reduce reduces a matrix to a vector.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga4b78072a303f29d9031d56e5638da78e
func Remap ¶
func Remap(src Mat, dst, map1, map2 *Mat, interpolation InterpolationFlags, borderMode BorderType, borderValue color.RGBA)
Remap applies a generic geometrical transformation to an image.
For further details, please see: https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gab75ef31ce5cdfb5c44b6da5f3b908ea4
func Repeat ¶
Repeat fills the output array with repeated copies of the input array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga496c3860f3ac44c40b48811333cfda2d
func Resize ¶
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/master/da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d
func Rotate ¶
func Rotate(src Mat, dst *Mat, code RotateFlag)
Rotate rotates a 2D array in multiples of 90 degrees
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga4ad01c0978b0ce64baa246811deeac24
func ScaleAdd ¶
Calculates the sum of a scaled array and another array.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9e0845db4135f55dcf20227402f00d98
func Scharr ¶
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/master/d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9
func SelectROI ¶
SelectROI selects a Region Of Interest (ROI) on the given image. It creates a window and allows user to select a ROI using mouse.
Controls: use space or enter to finish selection, use key c to cancel selection (function will return a zero Rect).
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga8daf4730d3adf7035b6de9be4c469af5
func SelectROIs ¶
SelectROIs selects multiple Regions Of Interest (ROI) on the given image. It creates a window and allows user to select ROIs using mouse.
Controls: use space or enter to finish current selection and start a new one use esc to terminate multiple ROI selection process
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga0f11fad74a6432b8055fb21621a0f893
func SepFilter2D ¶
func SepFilter2D(src Mat, dst *Mat, ddepth int, kernelX, kernelY Mat, anchor image.Point, delta float64, borderType BorderType)
SepFilter2D applies a separable linear filter to the image.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d
func Sobel ¶
func Sobel(src Mat, dst *Mat, ddepth, dx, dy, ksize int, scale, delta float64, borderType BorderType)
Sobel calculates the first, second, third, or mixed image derivatives using an extended Sobel operator
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d
func Solve ¶
func Solve(src1 Mat, src2 Mat, dst *Mat, flags SolveDecompositionFlags) bool
Solve solves one or more linear systems or least-squares problems.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga12b43690dbd31fed96f213eefead2373
func SolveCubic ¶
SolveCubic finds the real roots of a cubic equation.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga1c3b0b925b085b6e96931ee309e6a1da
func SolvePoly ¶
SolvePoly finds the real or complex roots of a polynomial equation.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gac2f5e953016fabcdf793d762f4ec5dce
func Sort ¶
Sort sorts each row or each column of a matrix.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga45dd56da289494ce874be2324856898f
func SortIdx ¶
SortIdx sorts each row or each column of a matrix. Instead of reordering the elements themselves, it stores the indices of sorted elements in the output array
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gadf35157cbf97f3cb85a545380e383506
func SpatialGradient ¶
func SpatialGradient(src Mat, dx, dy *Mat, ksize int, borderType BorderType)
SpatialGradient calculates the first order image derivative in both x and y using a Sobel operator.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga405d03b20c782b65a4daf54d233239a2
func SqBoxFilter ¶
SqBoxFilter calculates the normalized sum of squares of the pixel values overlapping the filter.
For further details, please see: https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga045028184a9ef65d7d2579e5c4bff6c0
func Subtract ¶
Subtract calculates the per-element subtraction of two arrays or an array and a scalar.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa0f00d98b4b5edeaeb7b8333b2de353b
func Threshold ¶
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 Transform ¶
Transform performs the matrix transformation of every array element.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga393164aa54bb9169ce0a8cc44e08ff22
func Transpose ¶
Transpose transposes a matrix.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga46630ed6c0ea6254a35f447289bd7404
func Vconcat ¶
Vconcat applies vertical concatenation to given matrices.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaab5ceee39e0580f879df645a872c6bf7
func WaitKey ¶
WaitKey that is not attached to a specific Window. Only use when no Window exists in your application, e.g. command line app.
func WarpAffine ¶
WarpAffine applies an affine transformation to an image. For more parameters please check WarpAffineWithParams
For further details, please see: https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983
func WarpAffineWithParams ¶
func WarpAffineWithParams(src Mat, dst *Mat, m Mat, sz image.Point, flags InterpolationFlags, borderType BorderType, borderValue color.RGBA)
WarpAffineWithParams applies an affine transformation to an image.
For further details, please see: https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983
func WarpPerspective ¶
WarpPerspective applies a perspective transformation to an image.
For further details, please see: https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaf73673a7e8e18ec6963e3774e6a94b87
Types ¶
type AKAZE ¶
type AKAZE struct {
// contains filtered or unexported fields
}
AKAZE is a wrapper around the cv::AKAZE algorithm.
func NewAKAZE ¶
func NewAKAZE() AKAZE
NewAKAZE returns a new AKAZE algorithm
For further details, please see: https://docs.opencv.org/master/d8/d30/classcv_1_1AKAZE.html
func (*AKAZE) Detect ¶
Detect keypoints in an image using AKAZE.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
func (*AKAZE) DetectAndCompute ¶
DetectAndCompute keypoints and compute in an image using AKAZE.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
type AdaptiveThresholdType ¶
type AdaptiveThresholdType int
AdaptiveThresholdType type of adaptive threshold operation.
const ( // AdaptiveThresholdMean threshold type AdaptiveThresholdMean AdaptiveThresholdType = 0 // AdaptiveThresholdGaussian threshold type AdaptiveThresholdGaussian = 1 )
type AgastFeatureDetector ¶
type AgastFeatureDetector struct {
// contains filtered or unexported fields
}
AgastFeatureDetector is a wrapper around the cv::AgastFeatureDetector.
func NewAgastFeatureDetector ¶
func NewAgastFeatureDetector() AgastFeatureDetector
NewAgastFeatureDetector returns a new AgastFeatureDetector algorithm
For further details, please see: https://docs.opencv.org/master/d7/d19/classcv_1_1AgastFeatureDetector.html
func (*AgastFeatureDetector) Close ¶
func (a *AgastFeatureDetector) Close() error
Close AgastFeatureDetector.
func (*AgastFeatureDetector) Detect ¶
func (a *AgastFeatureDetector) Detect(src Mat) []KeyPoint
Detect keypoints in an image using AgastFeatureDetector.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
type BFMatcher ¶
type BFMatcher struct {
// contains filtered or unexported fields
}
BFMatcher is a wrapper around the the cv::BFMatcher algorithm
func NewBFMatcher ¶
func NewBFMatcher() BFMatcher
NewBFMatcher returns a new BFMatcher
For further details, please see: https://docs.opencv.org/master/d3/da1/classcv_1_1BFMatcher.html#abe0bb11749b30d97f60d6ade665617bd
func NewBFMatcherWithParams ¶
NewBFMatcherWithParams creates a new BFMatchers but allows setting parameters to values other than just the defaults.
For further details, please see: https://docs.opencv.org/master/d3/da1/classcv_1_1BFMatcher.html#abe0bb11749b30d97f60d6ade665617bd
func (*BFMatcher) KnnMatch ¶
KnnMatch Finds the k best matches for each descriptor from a query set.
For further details, please see: https://docs.opencv.org/master/db/d39/classcv_1_1DescriptorMatcher.html#aa880f9353cdf185ccf3013e08210483a
type BRISK ¶
type BRISK struct {
// contains filtered or unexported fields
}
BRISK is a wrapper around the cv::BRISK algorithm.
func NewBRISK ¶
func NewBRISK() BRISK
NewBRISK returns a new BRISK algorithm
For further details, please see: https://docs.opencv.org/master/d8/d30/classcv_1_1AKAZE.html
func (*BRISK) Detect ¶
Detect keypoints in an image using BRISK.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
func (*BRISK) DetectAndCompute ¶
DetectAndCompute keypoints and compute in an image using BRISK.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
type BackgroundSubtractorKNN ¶
type BackgroundSubtractorKNN struct {
// contains filtered or unexported fields
}
BackgroundSubtractorKNN is a wrapper around the cv::BackgroundSubtractorKNN.
func NewBackgroundSubtractorKNN ¶
func NewBackgroundSubtractorKNN() BackgroundSubtractorKNN
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/master/db/d88/classcv_1_1BackgroundSubtractorKNN.html
func (*BackgroundSubtractorKNN) Apply ¶
func (k *BackgroundSubtractorKNN) Apply(src Mat, dst *Mat)
Apply computes a foreground mask using the current BackgroundSubtractorKNN.
For further details, please see: https://docs.opencv.org/master/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21
func (*BackgroundSubtractorKNN) Close ¶
func (k *BackgroundSubtractorKNN) Close() error
Close BackgroundSubtractorKNN.
type BackgroundSubtractorMOG2 ¶
type BackgroundSubtractorMOG2 struct {
// contains filtered or unexported fields
}
BackgroundSubtractorMOG2 is a wrapper around the cv::BackgroundSubtractorMOG2.
func NewBackgroundSubtractorMOG2 ¶
func NewBackgroundSubtractorMOG2() BackgroundSubtractorMOG2
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/master/d7/d7b/classcv_1_1BackgroundSubtractorMOG2.html
func (*BackgroundSubtractorMOG2) Apply ¶
func (b *BackgroundSubtractorMOG2) Apply(src Mat, dst *Mat)
Apply computes a foreground mask using the current BackgroundSubtractorMOG2.
For further details, please see: https://docs.opencv.org/master/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21
func (*BackgroundSubtractorMOG2) Close ¶
func (b *BackgroundSubtractorMOG2) Close() error
Close BackgroundSubtractorMOG2.
type CalibFlag ¶
type CalibFlag int32
CalibFlag value for calibration
const ( // CalibUseIntrinsicGuess indicates that cameraMatrix contains valid initial values // of fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially // set to the image center ( imageSize is used), and focal distances are computed // in a least-squares fashion. CalibUseIntrinsicGuess CalibFlag = 1 << iota // CalibRecomputeExtrinsic indicates that extrinsic will be recomputed after each // iteration of intrinsic optimization. CalibRecomputeExtrinsic // CalibCheckCond indicates that the functions will check validity of condition number CalibCheckCond // CalibFixSkew indicates that skew coefficient (alpha) is set to zero and stay zero CalibFixSkew // CalibFixK1 indicates that selected distortion coefficients are set to zeros and stay zero CalibFixK1 // CalibFixK2 indicates that selected distortion coefficients are set to zeros and stay zero CalibFixK2 // CalibFixK3 indicates that selected distortion coefficients are set to zeros and stay zero CalibFixK3 // CalibFixK4 indicates that selected distortion coefficients are set to zeros and stay zero CalibFixK4 // CalibFixIntrinsic indicates that fix K1, K2? and D1, D2? so that only R, T matrices are estimated CalibFixIntrinsic // CalibFixPrincipalPoint indicates that the principal point is not changed during the global optimization. // It stays at the center or at a different location specified when CalibUseIntrinsicGuess is set too. CalibFixPrincipalPoint )
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/master/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/master/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498
func (*CascadeClassifier) DetectMultiScaleWithParams ¶
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/master/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/master/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/master/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0
type ColormapTypes ¶
type ColormapTypes int
ColormapTypes are the 12 GNU Octave/MATLAB equivalent colormaps.
For further details, please see: https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html
type CompareType ¶
type CompareType int
CompareType is used for Compare operations to indicate which kind of comparison to use.
type ContourApproximationMode ¶
type ContourApproximationMode int
ContourApproximationMode is the mode of the contour approximation algorithm.
type CovarFlags ¶
type CovarFlags int
CovarFlags are the covariation flags used by functions such as BorderInterpolate.
For further details, please see: https://docs.opencv.org/master/d0/de1/group__core.html#ga719ebd4a73f30f4fab258ab7616d0f0f
type DMatch ¶
DMatch is data structure for matching keypoint descriptors.
For further details, please see: https://docs.opencv.org/master/d4/de0/classcv_1_1DMatch.html#a546ddb9a87898f06e510e015a6de596e
type DftFlags ¶
type DftFlags int
DftFlags represents a DFT or DCT flag.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaf4dde112b483b38175621befedda1f1c
type DistanceTypes ¶
type DistanceTypes int
DistanceTypes types for Distance Transform and M-estimatorss
For further details, please see: https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#gaa2bfbebbc5c320526897996aafa1d8eb
type DrawMatchesFlag ¶
type DrawMatchesFlag int
DrawMatchesFlag are the flags setting drawing feature
For further details please see: https://docs.opencv.org/master/de/d30/structcv_1_1DrawMatchesFlags.html
type FastFeatureDetector ¶
type FastFeatureDetector struct {
// contains filtered or unexported fields
}
FastFeatureDetector is a wrapper around the cv::FastFeatureDetector.
func NewFastFeatureDetector ¶
func NewFastFeatureDetector() FastFeatureDetector
NewFastFeatureDetector returns a new FastFeatureDetector algorithm
For further details, please see: https://docs.opencv.org/master/df/d74/classcv_1_1FastFeatureDetector.html
func (*FastFeatureDetector) Close ¶
func (f *FastFeatureDetector) Close() error
Close FastFeatureDetector.
func (*FastFeatureDetector) Detect ¶
func (f *FastFeatureDetector) Detect(src Mat) []KeyPoint
Detect keypoints in an image using FastFeatureDetector.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
type GFTTDetector ¶
type GFTTDetector struct {
// contains filtered or unexported fields
}
GFTTDetector is a wrapper around the cv::GFTTDetector algorithm.
func NewGFTTDetector ¶
func NewGFTTDetector() GFTTDetector
NewGFTTDetector returns a new GFTTDetector algorithm
For further details, please see: https://docs.opencv.org/master/df/d21/classcv_1_1GFTTDetector.html
func (*GFTTDetector) Detect ¶
func (a *GFTTDetector) Detect(src Mat) []KeyPoint
Detect keypoints in an image using GFTTDetector.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
type HOGDescriptor ¶
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/master/d5/d33/structcv_1_1HOGDescriptor.html#a723b95b709cfd3f95cf9e616de988fc8
func NewHOGDescriptor ¶
func NewHOGDescriptor() HOGDescriptor
NewHOGDescriptor returns a new HOGDescriptor.
func (*HOGDescriptor) Close ¶
func (h *HOGDescriptor) Close() error
Close deletes the HOGDescriptor's pointer.
func (*HOGDescriptor) DetectMultiScale ¶
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/master/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
func (*HOGDescriptor) DetectMultiScaleWithParams ¶
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/master/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
func (*HOGDescriptor) SetSVMDetector ¶
func (h *HOGDescriptor) SetSVMDetector(det Mat) error
SetSVMDetector sets the data for the HOGDescriptor.
For further details, please see: https://docs.opencv.org/master/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 ¶
type InterpolationFlags int
InterpolationFlags are bit flags that control the interpolation algorithm that is used.
type KAZE ¶
type KAZE struct {
// contains filtered or unexported fields
}
KAZE is a wrapper around the cv::KAZE algorithm.
func NewKAZE ¶
func NewKAZE() KAZE
NewKAZE returns a new KAZE algorithm
For further details, please see: https://docs.opencv.org/master/d3/d61/classcv_1_1KAZE.html
func (*KAZE) Detect ¶
Detect keypoints in an image using KAZE.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
func (*KAZE) DetectAndCompute ¶
DetectAndCompute keypoints and compute in an image using KAZE.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
type KeyPoint ¶
KeyPoint is data structure for salient point detectors.
For further details, please see: https://docs.opencv.org/master/d2/d29/classcv_1_1KeyPoint.html
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer is a wrapper around the cv::dnn::Layer algorithm.
func (*Layer) InputNameToIndex ¶
InputNameToIndex returns index of input blob in input array.
For further details, please see: https://docs.opencv.org/master/d3/d6c/classcv_1_1dnn_1_1Layer.html#a60ffc8238f3fa26cd3f49daa7ac0884b
func (*Layer) OutputNameToIndex ¶
OutputNameToIndex returns index of output blob in output array.
For further details, please see: https://docs.opencv.org/master/d3/d6c/classcv_1_1dnn_1_1Layer.html#a60ffc8238f3fa26cd3f49daa7ac0884b
type MSER ¶
type MSER struct {
// contains filtered or unexported fields
}
MSER is a wrapper around the cv::MSER algorithm.
func NewMSER ¶
func NewMSER() MSER
NewMSER returns a new MSER algorithm
For further details, please see: https://docs.opencv.org/master/d3/d28/classcv_1_1MSER.html
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/master/d3/d63/classcv_1_1Mat.html
func BlobFromImage ¶
func BlobFromImage(img Mat, scaleFactor float64, size image.Point, mean Scalar, swapRB bool, crop bool) Mat
BlobFromImage creates 4-dimensional blob from image. Optionally resizes and crops image from center, subtract mean values, scales values by scalefactor, swap Blue and Red channels.
For further details, please see: https://docs.opencv.org/trunk/d6/d0f/group__dnn.html#ga152367f253c81b53fe6862b299f5c5cd
func GetBlobChannel ¶
GetBlobChannel extracts a single (2d)channel from a 4 dimensional blob structure (this might e.g. contain the results of a SSD or YOLO detection,
a bones structure from pose detection, or a color plane from Colorization)
func GetPerspectiveTransform ¶
GetPerspectiveTransform returns 3x3 perspective transformation for the corresponding 4 point pairs.
For further details, please see: https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga8c1ae0e3589a9d77fffc962c49b22043
func GetRotationMatrix2D ¶
GetRotationMatrix2D calculates an affine matrix of 2D rotation.
For further details, please see: https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gafbbc470ce83812914a70abfb604f4326
func GetStructuringElement ¶
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/master/d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc
func HOGDefaultPeopleDetector ¶
func HOGDefaultPeopleDetector() Mat
HOGDefaultPeopleDetector returns a new Mat with the HOG DefaultPeopleDetector.
For further details, please see: https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948
func IMDecode ¶
func IMDecode(buf []byte, flags IMReadFlag) (Mat, error)
IMDecode reads an image from a buffer in memory. The function IMDecode reads an image from the specified buffer in memory. If the buffer is too short or contains invalid data, the function returns an empty matrix.
For further details, please see: https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga26a67788faa58ade337f8d28ba0eb19e
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/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56
func ImageGrayToMatGray ¶
ImageGrayToMatGray converts image.Gray to gocv.Mat, which represents grayscale image 8bit. Type of Mat is gocv.MatTypeCV8UC1.
func ImageToMatRGB ¶
ImageToMatRGB converts image.Image to gocv.Mat, which represents RGB image having 8bit for each component. Type of Mat is gocv.MatTypeCV8UC3.
func ImageToMatRGBA ¶
ImageToMatRGBA converts image.Image to gocv.Mat, which represents RGBA image having 8bit for each component. Type of Mat is gocv.MatTypeCV8UC4.
func NewMatFromBytes ¶
NewMatFromBytes returns a new Mat with a specific size and type, initialized from a []byte.
func NewMatFromScalar ¶
NewMatFromScalar returns a new Mat for a specific Scalar value
func NewMatWithSize ¶
NewMatWithSize returns a new Mat with a specific size and type.
func NewMatWithSizeFromScalar ¶
NewMatWithSizeFromScalar returns a new Mat for a specific Scala value with a specific size and type This simplifies creation of specific color filters or creating Mats of specific colors and sizes
func Split ¶
Split creates an array of single channel images from a multi-channel image
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga0547c7fed86152d7e9d0096029c8518a
func (*Mat) AddFloat ¶
AddFloat adds a float value to each element in the Mat. Performs a mat += val operation.
func (*Mat) AddUChar ¶
AddUChar adds a uchar value to each element in the Mat. Performs a mat += val operation.
func (*Mat) ConvertFp16 ¶
ConvertFp16 converts a Mat to half-precision floating point.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9c25d9ef44a2a48ecc3774b30cb80082
func (*Mat) ConvertTo ¶
ConvertTo converts Mat into destination Mat.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#adf88c60c5b4980e05bb556080916978b
func (*Mat) CopyTo ¶
CopyTo copies Mat into destination Mat.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a33fd5d125b4c302b0c9aa86980791a77
func (*Mat) CopyToWithMask ¶
CopyToWithMask copies Mat into destination Mat after applying the mask Mat.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a626fe5f96d02525e2604d2ad46dd574f
func (*Mat) DataPtrFloat32 ¶
DataPtrFloat32 returns a slice that references the OpenCV allocated data.
The data is no longer valid once the Mat has been closed. Any data that needs to be accessed after the Mat is closed must be copied into Go memory.
func (*Mat) DataPtrFloat64 ¶
DataPtrFloat64 returns a slice that references the OpenCV allocated data.
The data is no longer valid once the Mat has been closed. Any data that needs to be accessed after the Mat is closed must be copied into Go memory.
func (*Mat) DataPtrInt16 ¶
DataPtrInt16 returns a slice that references the OpenCV allocated data.
The data is no longer valid once the Mat has been closed. Any data that needs to be accessed after the Mat is closed must be copied into Go memory.
func (*Mat) DataPtrInt8 ¶
DataPtrInt8 returns a slice that references the OpenCV allocated data.
The data is no longer valid once the Mat has been closed. Any data that needs to be accessed after the Mat is closed must be copied into Go memory.
func (*Mat) DataPtrUint16 ¶
DataPtrUint16 returns a slice that references the OpenCV allocated data.
The data is no longer valid once the Mat has been closed. Any data that needs to be accessed after the Mat is closed must be copied into Go memory.
func (*Mat) DataPtrUint8 ¶
DataPtrUint8 returns a slice that references the OpenCV allocated data.
The data is no longer valid once the Mat has been closed. Any data that needs to be accessed after the Mat is closed must be copied into Go memory.
func (*Mat) DivideFloat ¶
DivideFloat divides each element in the Mat by a float value. Performs a mat /= val operation.
func (*Mat) DivideUChar ¶
DivideUChar divides each element in the Mat by a uint value. Performs a mat /= val operation.
func (*Mat) FromPtr ¶
FromPtr returns a new Mat with a specific size and type, initialized from a Mat Ptr.
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) GetDoubleAt3 ¶
GetDoubleAt3 returns a value from a specific x, y, z coordinate location 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) GetFloatAt3 ¶
GetFloatAt3 returns a value from a specific x, y, z coordinate location 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) GetIntAt3 ¶
GetIntAt3 returns a value from a specific x, y, z coordinate location 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) GetSCharAt3 ¶
GetSCharAt3 returns a value from a specific x, y, z coordinate location 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) GetShortAt3 ¶
GetShortAt3 returns a value from a specific x, y, z coordinate location 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) GetUCharAt3 ¶
GetUCharAt3 returns a value from a specific x, y, z coordinate location in this Mat expecting it to be of type uchar aka CV_8U.
func (*Mat) GetVecfAt ¶
GetVecfAt returns a vector of floats. Its size corresponds to the number of channels of the Mat.
func (*Mat) GetVeciAt ¶
GetVeciAt returns a vector of integers. Its size corresponds to the number of channels of the Mat.
func (*Mat) Mean ¶
Mean calculates the mean value M of array elements, independently for each channel, and return it as Scalar TODO pass second paramter with mask
func (*Mat) MultiplyFloat ¶
MultiplyFloat multiplies each element in the Mat by a float value. Performs a mat *= val operation.
func (*Mat) MultiplyUChar ¶
MultiplyUChar multiplies each element in the Mat by a uint value. Performs a mat *= val operation.
func (*Mat) PatchNaNs ¶
func (m *Mat) PatchNaNs()
PatchNaNs converts NaN's to zeros.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga62286befb7cde3568ff8c7d14d5079da
func (*Mat) Region ¶
Region returns a new Mat that points to a region of this Mat. Changes made to the region Mat will affect the original Mat, since they are pointers to the underlying OpenCV Mat object.
func (*Mat) Reshape ¶
Reshape changes the shape and/or the number of channels of a 2D matrix without copying the data.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a4eb96e3251417fa88b78e2abd6cfd7d8
func (*Mat) SetDoubleAt ¶
SetDoubleAt sets a value at a specific row/col in this Mat expecting it to be of type double aka CV_64F.
func (*Mat) SetDoubleAt3 ¶
SetDoubleAt3 sets a value at a specific x, y, z coordinate location in this Mat expecting it to be of type double aka CV_64F.
func (*Mat) SetFloatAt ¶
SetFloatAt sets a value at a specific row/col in this Mat expecting it to be of type float aka CV_32F.
func (*Mat) SetFloatAt3 ¶
SetFloatAt3 sets a value at a specific x, y, z coordinate location in this Mat expecting it to be of type float aka CV_32F.
func (*Mat) SetIntAt ¶
SetIntAt sets a value at a specific row/col in this Mat expecting it to be of type int aka CV_32S.
func (*Mat) SetIntAt3 ¶
SetIntAt3 sets a value at a specific x, y, z coordinate location in this Mat expecting it to be of type int aka CV_32S.
func (*Mat) SetSCharAt ¶
SetSCharAt sets a value at a specific row/col in this Mat expecting it to be of type schar aka CV_8S.
func (*Mat) SetSCharAt3 ¶
SetSCharAt3 sets a value at a specific x, y, z coordinate location in this Mat expecting it to be of type schar aka CV_8S.
func (*Mat) SetShortAt ¶
SetShortAt sets a value at a specific row/col in this Mat expecting it to be of type short aka CV_16S.
func (*Mat) SetShortAt3 ¶
SetShortAt3 sets a value at a specific x, y, z coordinate location in this Mat expecting it to be of type short aka CV_16S.
func (*Mat) SetUCharAt ¶
SetUCharAt sets a value at a specific row/col in this Mat expecting it to be of type uchar aka CV_8U.
func (*Mat) SetUCharAt3 ¶
SetUCharAt3 sets a value at a specific x, y, z coordinate location in this Mat expecting it to be of type uchar aka CV_8U.
func (*Mat) Size ¶
Size returns an array with one element for each dimension containing the size of that dimension for the Mat.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa4d317d43fb0cba9c2503f3c61b866c8
func (*Mat) Sqrt ¶
Sqrt calculates a square root of array elements.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga186222c3919657890f88df5a1f64a7d7
func (*Mat) SubtractFloat ¶
SubtractFloat subtracts a float value from each element in the Mat. Performs a mat -= val operation.
func (*Mat) SubtractUChar ¶
SubtractUChar subtracts a uchar value from each element in the Mat. Performs a mat -= val operation.
func (*Mat) Sum ¶
Sum calculates the per-channel pixel sum of an image.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga716e10a2dd9e228e4d3c95818f106722
func (*Mat) ToBytes ¶
ToBytes copies the underlying Mat data to a byte array.
For further details, please see: https://docs.opencv.org/3.3.1/d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564
func (*Mat) Total ¶
Total returns the total number of array elements.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa4d317d43fb0cba9c2503f3c61b866c8
type MatType ¶
type MatType int
MatType is the type for the various different kinds of Mat you can create.
type MorphShape ¶
type MorphShape int
MorphShape is the shape of the structuring element used for Morphing operations.
type Net ¶
type Net struct {
// contains filtered or unexported fields
}
Net allows you to create and manipulate comprehensive artificial neural networks.
For further details, please see: https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html
func ReadNet ¶
ReadNet reads a deep learning network represented in one of the supported formats.
For further details, please see: https://docs.opencv.org/3.4/d6/d0f/group__dnn.html#ga3b34fe7a29494a6a4295c169a7d32422
func ReadNetFromCaffe ¶
ReadNetFromCaffe reads a network model stored in Caffe framework's format.
For further details, please see: https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga946b342af1355185a7107640f868b64a
func ReadNetFromTensorflow ¶
ReadNetFromTensorflow reads a network model stored in Tensorflow framework's format.
For further details, please see: https://docs.opencv.org/master/d6/d0f/group__dnn.html#gad820b280978d06773234ba6841e77e8d
func (*Net) Empty ¶
Empty returns true if there are no layers in the network.
For further details, please see: https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#a6a5778787d5b8770deab5eda6968e66c
func (*Net) Forward ¶
Forward runs forward pass to compute output of layer with name outputName.
For further details, please see: https://docs.opencv.org/trunk/db/d30/classcv_1_1dnn_1_1Net.html#a98ed94cb6ef7063d3697259566da310b
func (*Net) ForwardLayers ¶
ForwardLayers forward pass to compute outputs of layers listed in outBlobNames.
For further details, please see: https://docs.opencv.org/3.4.1/db/d30/classcv_1_1dnn_1_1Net.html#adb34d7650e555264c7da3b47d967311b
func (*Net) GetLayer ¶
GetLayer returns pointer to layer with specified id from the network.
For further details, please see: https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#a70aec7f768f38c32b1ee25f3a56526df
func (*Net) GetPerfProfile ¶
GetPerfProfile returns overall time for inference and timings (in ticks) for layers
For further details, please see: https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#a06ce946f675f75d1c020c5ddbc78aedc
func (*Net) GetUnconnectedOutLayers ¶
GetUnconnectedOutLayers returns indexes of layers with unconnected outputs.
For further details, please see: https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#ae62a73984f62c49fd3e8e689405b056a
func (*Net) SetInput ¶
SetInput sets the new value for the layer output blob.
For further details, please see: https://docs.opencv.org/trunk/db/d30/classcv_1_1dnn_1_1Net.html#a672a08ae76444d75d05d7bfea3e4a328
func (*Net) SetPreferableBackend ¶
func (net *Net) SetPreferableBackend(backend NetBackendType) error
SetPreferableBackend ask network to use specific computation backend.
For further details, please see: https://docs.opencv.org/3.4/db/d30/classcv_1_1dnn_1_1Net.html#a7f767df11386d39374db49cd8df8f59e
func (*Net) SetPreferableTarget ¶
func (net *Net) SetPreferableTarget(target NetTargetType) error
SetPreferableTarget ask network to make computations on specific target device.
For further details, please see: https://docs.opencv.org/3.4/db/d30/classcv_1_1dnn_1_1Net.html#a9dddbefbc7f3defbe3eeb5dc3d3483f4
type NetBackendType ¶
type NetBackendType int
NetBackendType is the type for the various different kinds of DNN backends.
const ( // NetBackendDefault is the default backend. NetBackendDefault NetBackendType = 0 // NetBackendHalide is the Halide backend. NetBackendHalide NetBackendType = 1 // NetBackendOpenVINO is the OpenVINO backend. NetBackendOpenVINO NetBackendType = 2 // NetBackendOpenCV is the OpenCV backend. NetBackendOpenCV NetBackendType = 3 )
func ParseNetBackend ¶
func ParseNetBackend(backend string) NetBackendType
ParseNetBackend returns a valid NetBackendType given a string. Valid values are: - halide - openvino - opencv - default
type NetTargetType ¶
type NetTargetType int
NetTargetType is the type for the various different kinds of DNN device targets.
const ( // NetTargetCPU is the default CPU device target. NetTargetCPU NetTargetType = 0 // NetTargetFP32 is the 32-bit OpenCL target. NetTargetFP32 NetTargetType = 1 // NetTargetFP16 is the 16-bit OpenCL target. NetTargetFP16 NetTargetType = 2 // NetTargetVPU is the Movidius VPU target. NetTargetVPU NetTargetType = 3 )
func ParseNetTarget ¶
func ParseNetTarget(target string) NetTargetType
ParseNetTarget returns a valid NetTargetType given a string. Valid values are: - cpu - fp32 - fp16 - vpu
type NormType ¶
type NormType int
NormType for normalization operations.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gad12cefbcb5291cf958a85b4b67b6149f
type ORB ¶
type ORB struct {
// contains filtered or unexported fields
}
ORB is a wrapper around the cv::ORB.
func NewORB ¶
func NewORB() ORB
NewORB returns a new ORB algorithm
For further details, please see: https://docs.opencv.org/master/d7/d19/classcv_1_1AgastFeatureDetector.html
func (*ORB) Detect ¶
Detect keypoints in an image using ORB.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
func (*ORB) DetectAndCompute ¶
DetectAndCompute detects keypoints and computes from an image using ORB.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677
type ReduceTypes ¶
type ReduceTypes int
const ( // The output is the sum of all rows/columns of the matrix. ReduceSum ReduceTypes = 0 // The output is the mean vector of all rows/columns of the matrix. ReduceAvg ReduceTypes = 1 // The output is the maximum (column/row-wise) of all rows/columns of the matrix. ReduceMax ReduceTypes = 2 // The output is the minimum (column/row-wise) of all rows/columns of the matrix. ReduceMin ReduceTypes = 3 )
type RetrievalMode ¶
type RetrievalMode int
RetrievalMode is the mode of the contour retrieval algorithm.
type RotateFlag ¶
type RotateFlag int
RotateFlag for image rotation
For further details please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6f45d55c0b1cc9d97f5353a7c8a7aac2
type RotatedRect ¶
type RotatedRect struct { Contour []image.Point BoundingRect image.Rectangle Center image.Point Width int Height int Angle float64 }
func MinAreaRect ¶
func MinAreaRect(points []image.Point) RotatedRect
MinAreaRect finds a rotated rectangle of the minimum area enclosing the input 2D point set.
For further details, please see: https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#ga3d476a3417130ae5154aea421ca7ead9
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/master/d1/da0/classcv_1_1Scalar__.html
func GetBlobSize ¶
GetBlobSize retrieves the 4 dimensional size information in (N,C,H,W) order
func NewScalar ¶
NewScalar returns a new Scalar. These are usually colors typically being in BGR order.
func Trace ¶
Trace returns the trace of a matrix.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga3419ac19c7dcd2be4bd552a23e147dd8
type SimpleBlobDetector ¶
type SimpleBlobDetector struct {
// contains filtered or unexported fields
}
SimpleBlobDetector is a wrapper around the cv::SimpleBlobDetector.
func NewSimpleBlobDetector ¶
func NewSimpleBlobDetector() SimpleBlobDetector
NewSimpleBlobDetector returns a new SimpleBlobDetector algorithm
For further details, please see: https://docs.opencv.org/master/d0/d7a/classcv_1_1SimpleBlobDetector.html
func (*SimpleBlobDetector) Close ¶
func (b *SimpleBlobDetector) Close() error
Close SimpleBlobDetector.
func (*SimpleBlobDetector) Detect ¶
func (b *SimpleBlobDetector) Detect(src Mat) []KeyPoint
Detect keypoints in an image using SimpleBlobDetector.
For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887
type SolveDecompositionFlags ¶
type SolveDecompositionFlags int
type SortFlags ¶
type SortFlags int
const ( // Each matrix row is sorted independently SortEveryRow SortFlags = 0 // Each matrix column is sorted independently; this flag and the previous one are mutually exclusive. SortEveryColumn SortFlags = 1 // Each matrix row is sorted in the ascending order. SortAscending SortFlags = 0 // Each matrix row is sorted in the descending order; this flag and the previous one are also mutually exclusive. SortDescending SortFlags = 16 )
type TemplateMatchMode ¶
type TemplateMatchMode int
TemplateMatchMode is the type of the template matching operation.
type TermCriteria ¶
type TermCriteria struct {
// contains filtered or unexported fields
}
TermCriteria is the criteria for iterative algorithms.
For further details, please see: https://docs.opencv.org/master/d9/d5d/classcv_1_1TermCriteria.html
func NewTermCriteria ¶
func NewTermCriteria(typ TermCriteriaType, maxCount int, epsilon float64) TermCriteria
NewTermCriteria returns a new TermCriteria.
type TermCriteriaType ¶
type TermCriteriaType int
TermCriteriaType for TermCriteria.
For further details, please see: https://docs.opencv.org/master/d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57
type Trackbar ¶
type Trackbar struct {
// contains filtered or unexported fields
}
Trackbar is a wrapper around OpenCV's "HighGUI" window Trackbars.
func (*Trackbar) GetPos ¶
GetPos returns the trackbar position.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga122632e9e91b9ec06943472c55d9cda8
func (*Trackbar) SetMax ¶
SetMax sets the trackbar maximum position.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga7e5437ccba37f1154b65210902fc4480
func (*Trackbar) SetMin ¶
SetMin sets the trackbar minimum position.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#gabe26ffe8d2b60cc678895595a581b7aa
func (*Trackbar) SetPos ¶
SetPos sets the trackbar position.
For further details, please see: https://docs.opencv.org/master/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/master/d8/dfe/classcv_1_1VideoCapture.html
func OpenVideoCapture ¶
func OpenVideoCapture(v interface{}) (*VideoCapture, error)
OpenVideoCapture return VideoCapture specified by device ID if v is a number. Return VideoCapture created from video file, URL, or GStreamer pipeline if v is a string.
func VideoCaptureDevice ¶
func VideoCaptureDevice(device int) (vc *VideoCapture, err error)
VideoCaptureDevice opens a VideoCapture from a device and prepares to start capturing. It returns error if it fails to open the video device.
func VideoCaptureFile ¶
func VideoCaptureFile(uri string) (vc *VideoCapture, err error)
VideoCaptureFile opens a VideoCapture from a file and prepares to start capturing. It returns error if it fails to open the file stored in uri path.
func (*VideoCapture) CodecString ¶
func (v *VideoCapture) CodecString() string
CodecString returns a string representation of FourCC bytes, i.e. the name of a codec
func (VideoCapture) Get ¶
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 reads the next frame from the VideoCapture to the Mat passed in as the param. 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/master/dd/d9e/classcv_1_1VideoWriter.html
func VideoWriterFile ¶
func VideoWriterFile(name string, codec string, fps float64, width int, height int, isColor bool) (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/master/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/master/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/master/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/master/d7/dfc/group__highgui.html
func NewWindow ¶
NewWindow creates a new named OpenCV window
For further details, please see: http://docs.opencv.org/master/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/master/d7/dfc/group__highgui.html#ga851ccdd6961022d1d5b4c4f255dbab34
func (*Window) CreateTrackbar ¶
CreateTrackbar creates a trackbar and attaches it to the specified window.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#gaf78d2155d30b728fc413803745b67a9b
func (*Window) GetWindowProperty ¶
func (w *Window) GetWindowProperty(flag WindowPropertyFlag) float64
GetWindowProperty returns properties of a window.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#gaaf9504b8f9cf19024d9d44a14e461656
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/master/d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563
func (*Window) MoveWindow ¶
MoveWindow moves window to the specified position.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga8d86b207f7211250dbe6e28f76307ffb
func (*Window) ResizeWindow ¶
ResizeWindow resizes window to the specified size.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga9e80e080f7ef33f897e415358aee7f7e
func (*Window) SetWindowProperty ¶
func (w *Window) SetWindowProperty(flag WindowPropertyFlag, value WindowFlag)
SetWindowProperty changes parameters of a window dynamically.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga66e4a6db4d4e06148bcdfe0d70a5df27
func (*Window) SetWindowTitle ¶
SetWindowTitle updates window title.
For further details, please see: https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga56f8849295fd10d0c319724ddb773d96
func (*Window) 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/master/d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7
type WindowFlag ¶
type WindowFlag float32
WindowFlag value for SetWindowProperty / GetWindowProperty.
type WindowPropertyFlag ¶
type WindowPropertyFlag int
WindowPropertyFlag flags for SetWindowProperty / GetWindowProperty.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
hello
+build example
|
+build example |
Package contrib is the GoCV wrapper around OpenCV Contrib.
|
Package contrib is the GoCV wrapper around OpenCV Contrib. |
Package openvino is the GoCV wrapper around the Intel OpenVINO toolkit.
|
Package openvino is the GoCV wrapper around the Intel OpenVINO toolkit. |
ie
Package ie is the GoCV wrapper around the Intel OpenVINO toolkit's Inference Engine.
|
Package ie is the GoCV wrapper around the Intel OpenVINO toolkit's Inference Engine. |
pvl
Package pvl is the GoCV wrapper around the Intel OpenVINO toolkit's Photography vision Library (PVL).
|
Package pvl is the GoCV wrapper around the Intel OpenVINO toolkit's Photography vision Library (PVL). |