Documentation ¶
Overview ¶
Package to provide some OpenCV functions required in arcface inference. Some codes are borrowed from Gocv. The EstimateAffinePartial2DWithParams() is implemented by self because Gocv do not have it.
Index ¶
- Constants
- Variables
- func AbsDiff(src1, src2 Mat, dst *Mat)
- func Add(src1, src2 Mat, dst *Mat)
- func AddWeighted(src1 Mat, alpha float64, src2 Mat, beta float64, gamma float64, dst *Mat)
- func BatchDistance(src1 Mat, src2 Mat, dist Mat, dtype MatType, nidx Mat, normType NormType, ...)
- func BitwiseAnd(src1 Mat, src2 Mat, dst *Mat)
- func BitwiseAndWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat)
- func BitwiseNot(src1 Mat, dst *Mat)
- func BitwiseNotWithMask(src1 Mat, dst *Mat, mask Mat)
- func BitwiseOr(src1 Mat, src2 Mat, dst *Mat)
- func BitwiseOrWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat)
- func BitwiseXor(src1 Mat, src2 Mat, dst *Mat)
- func BitwiseXorWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat)
- func BorderInterpolate(p int, len int, borderType CovarFlags) int
- func CalcCovarMatrix(samples Mat, covar *Mat, mean *Mat, flags CovarFlags, ctype MatType)
- func CartToPolar(x Mat, y Mat, magnitude *Mat, angle *Mat, angleInDegrees bool)
- func CheckRange(src Mat) bool
- func Compare(src1 Mat, src2 Mat, dst *Mat, ct CompareType)
- func CompleteSymm(m Mat, lowerToUpper bool)
- func ConvertScaleAbs(src Mat, dst *Mat, alpha float64, beta float64)
- 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 Divide(src1 Mat, src2 Mat, dst *Mat)
- func Eigen(src Mat, eigenvalues *Mat, eigenvectors *Mat) bool
- func EigenNonSymmetric(src Mat, eigenvalues *Mat, eigenvectors *Mat)
- func Exp(src Mat, dst *Mat)
- func ExtractChannel(src Mat, dst *Mat, coi int)
- func FindNonZero(src Mat, idx *Mat)
- func Flip(src Mat, dst *Mat, flipCode int)
- func Gemm(src1, src2 Mat, alpha float64, src3 Mat, beta float64, dst *Mat, flags int)
- func GetOptimalDFTSize(vecsize int) int
- func GetTickCount() float64
- func GetTickFrequency() float64
- func Hconcat(src1, src2 Mat, dst *Mat)
- func IDCT(src Mat, dst *Mat, flags int)
- func IDFT(src Mat, dst *Mat, flags, nonzeroRows int)
- 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 SolveDecompositionFlags) float64
- func KMeans(data Mat, k int, bestLabels *Mat, criteria TermCriteria, attempts int, ...) float64
- func KMeansPoints(points PointVector, k int, bestLabels *Mat, criteria TermCriteria, ...) float64
- func LUT(src, wbLUT Mat, dst *Mat)
- func Log(src Mat, dst *Mat)
- func Magnitude(x, y Mat, magnitude *Mat)
- func Max(src1, src2 Mat, dst *Mat)
- func MeanStdDev(src Mat, dst *Mat, dstStdDev *Mat)
- 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 MixChannels(src []Mat, dst []Mat, fromTo []int)
- func MulSpectrums(a Mat, b Mat, dst *Mat, flags DftFlags)
- func Multiply(src1 Mat, src2 Mat, dst *Mat)
- func MultiplyWithParams(src1 Mat, src2 Mat, dst *Mat, scale float64, dtype MatType)
- func Norm(src1 Mat, normType NormType) float64
- func NormWithMats(src1 Mat, src2 Mat, normType NormType) float64
- func Normalize(src Mat, dst *Mat, alpha float64, beta float64, typ NormType)
- 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 RandN(mat *Mat, mean, stddev Scalar)
- func RandShuffle(mat *Mat)
- func RandShuffleWithParams(mat *Mat, iterFactor float64, rng RNG)
- func RandU(mat *Mat, low, high Scalar)
- func Reduce(src Mat, dst *Mat, dim int, rType ReduceTypes, dType MatType)
- func Repeat(src Mat, nY int, nX int, dst *Mat)
- func Rotate(src Mat, dst *Mat, code RotateFlag)
- func ScaleAdd(src1 Mat, alpha float64, src2 Mat, dst *Mat)
- func SetIdentity(src Mat, scalar float64)
- func SetRNGSeed(seed int)
- 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 Subtract(src1 Mat, src2 Mat, dst *Mat)
- func Transform(src Mat, dst *Mat, tm Mat)
- func Transpose(src Mat, dst *Mat)
- func Vconcat(src1, src2 Mat, dst *Mat)
- func WarpAffine(src Mat, dst *Mat, m Mat, sz image.Point)
- type ColorConversionCode
- type CompareType
- type CovarFlags
- type DMatch
- type DftFlags
- type KMeansFlags
- type KeyPoint
- type Mat
- func EstimateAffinePartial2DWithParams(from Point2fVector, to Point2fVector, inliers Mat, method int, ...) Mat
- func Eye(rows int, cols int, mt MatType) Mat
- func ImageToMatRGB(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 NewMatWithSizes(sizes []int, mt MatType) Mat
- func NewMatWithSizesFromBytes(sizes []int, mt MatType, data []byte) (Mat, error)
- func NewMatWithSizesWithScalar(sizes []int, mt MatType, s Scalar) Mat
- func Ones(rows int, cols int, mt MatType) Mat
- func Split(src Mat) (mv []Mat)
- func Zeros(rows int, cols int, mt MatType) 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) ColRange(start, end int) Mat
- func (m *Mat) Cols() int
- func (m *Mat) ConvertFp16() Mat
- func (m *Mat) ConvertTo(dst *Mat, mt MatType)
- func (m *Mat) ConvertToWithParams(dst *Mat, mt MatType, alpha, beta float32)
- 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, error)
- func (m *Mat) DataPtrUint16() ([]uint16, error)
- func (m *Mat) DataPtrUint8() ([]uint8, error)
- 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) GetVecbAt(row int, col int) Vecb
- func (m *Mat) GetVecdAt(row int, col int) Vecd
- func (m *Mat) GetVecfAt(row int, col int) Vecf
- func (m *Mat) GetVeciAt(row int, col int) Veci
- func (m *Mat) IsContinuous() bool
- func (m *Mat) Mean() Scalar
- func (m *Mat) MeanWithMask(mask Mat) Scalar
- func (m *Mat) MultiplyFloat(val float32)
- func (m *Mat) MultiplyMatrix(x Mat) Mat
- 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) RowRange(start, end 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) T() Mat
- 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 NativeByteBuffer
- type NormType
- type Point2f
- type Point2fVector
- type Point3f
- type Point3fVector
- type PointVector
- type Points2fVector
- func (pvs Points2fVector) Append(pv Point2fVector)
- func (pvs Points2fVector) At(idx int) Point2fVector
- func (pvs Points2fVector) Close()
- func (pvs Points2fVector) IsNil() bool
- func (pvs Points2fVector) P() C.Points2fVector
- func (pvs Points2fVector) Size() int
- func (pvs Points2fVector) ToPoints() [][]Point2f
- type Points3fVector
- type PointsVector
- type RNG
- type RNGDistType
- type ReduceTypes
- type RotateFlag
- type Scalar
- type SolveDecompositionFlags
- type SortFlags
- type TermCriteria
- type TermCriteriaType
- type Vecb
- type Vecd
- type Vecf
- type Veci
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 MatType = 1 // MatTypeCV16U is a Mat of 16-bit unsigned int MatTypeCV16U MatType = 2 // MatTypeCV16S is a Mat of 16-bit signed int MatTypeCV16S MatType = 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 MatType = 4 // MatTypeCV32F is a Mat of 32-bit float MatTypeCV32F MatType = 5 // MatTypeCV64F is a Mat of 64-bit float MatTypeCV64F MatType = 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 // MatTypeCV8SC1 is a Mat of 8-bit signed int with a single channel MatTypeCV8SC1 = MatTypeCV8S + MatChannels1 // MatTypeCV8SC2 is a Mat of 8-bit signed int with 2 channels MatTypeCV8SC2 = MatTypeCV8S + MatChannels2 // MatTypeCV8SC3 is a Mat of 8-bit signed int with 3 channels MatTypeCV8SC3 = MatTypeCV8S + MatChannels3 // MatTypeCV8SC4 is a Mat of 8-bit signed int with 4 channels MatTypeCV8SC4 = MatTypeCV8S + MatChannels4 // MatTypeCV16UC1 is a Mat of 16-bit unsigned int with a single channel MatTypeCV16UC1 = MatTypeCV16U + MatChannels1 // MatTypeCV16UC2 is a Mat of 16-bit unsigned int with 2 channels MatTypeCV16UC2 = MatTypeCV16U + MatChannels2 // MatTypeCV16UC3 is a Mat of 16-bit unsigned int with 3 channels MatTypeCV16UC3 = MatTypeCV16U + MatChannels3 // MatTypeCV16UC4 is a Mat of 16-bit unsigned int with 4 channels MatTypeCV16UC4 = MatTypeCV16U + MatChannels4 // MatTypeCV16SC1 is a Mat of 16-bit signed int with a single channel MatTypeCV16SC1 = MatTypeCV16S + MatChannels1 // MatTypeCV16SC3 is a Mat of 16-bit signed int with 3 channels MatTypeCV16SC3 = MatTypeCV16S + MatChannels3 // MatTypeCV16SC4 is a Mat of 16-bit signed int with 4 channels MatTypeCV16SC4 = MatTypeCV16S + MatChannels4 // MatTypeCV32SC1 is a Mat of 32-bit signed int with a single channel MatTypeCV32SC1 = MatTypeCV32S + MatChannels1 // MatTypeCV32SC2 is a Mat of 32-bit signed int with 2 channels MatTypeCV32SC2 = MatTypeCV32S + MatChannels2 // MatTypeCV32SC3 is a Mat of 32-bit signed int with 3 channels MatTypeCV32SC3 = MatTypeCV32S + MatChannels3 // MatTypeCV32SC4 is a Mat of 32-bit signed int with 4 channels MatTypeCV32SC4 = MatTypeCV32S + MatChannels4 // MatTypeCV32FC1 is a Mat of 32-bit float int with a single channel MatTypeCV32FC1 = MatTypeCV32F + MatChannels1 // MatTypeCV32FC2 is a Mat of 32-bit float int with 2 channels MatTypeCV32FC2 = MatTypeCV32F + MatChannels2 // MatTypeCV32FC3 is a Mat of 32-bit float int with 3 channels MatTypeCV32FC3 = MatTypeCV32F + MatChannels3 // MatTypeCV32FC4 is a Mat of 32-bit float int with 4 channels MatTypeCV32FC4 = MatTypeCV32F + MatChannels4 // MatTypeCV64FC1 is a Mat of 64-bit float int with a single channel MatTypeCV64FC1 = MatTypeCV64F + MatChannels1 // MatTypeCV64FC2 is a Mat of 64-bit float int with 2 channels MatTypeCV64FC2 = MatTypeCV64F + MatChannels2 // MatTypeCV64FC3 is a Mat of 64-bit float int with 3 channels MatTypeCV64FC3 = MatTypeCV64F + MatChannels3 // MatTypeCV64FC4 is a Mat of 64-bit float int with 4 channels MatTypeCV64FC4 = MatTypeCV64F + MatChannels4 )
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 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 BatchDistance ¶
func BatchDistance(src1 Mat, src2 Mat, dist Mat, dtype MatType, nidx Mat, normType NormType, 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 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 BitwiseAndWithMask ¶
BitwiseAndWithMask 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. It has an additional parameter for a mask.
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 BitwiseNotWithMask ¶
BitwiseNotWithMask inverts every bit of an array. It has an additional parameter for a mask.
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 BitwiseOrWithMask ¶
BitwiseOrWithMask calculates the per-element bit-wise disjunction of two arrays or an array and a scalar. It has an additional parameter for a mask.
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 BitwiseXorWithMask ¶
BitwiseXorWithMask calculates the per-element bit-wise "exclusive or" operation on two arrays or an array and a scalar. It has an additional parameter for a mask.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga84b2d8188ce506593dcc3f8cd00e8e2c
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 CalcCovarMatrix ¶
func CalcCovarMatrix(samples Mat, covar *Mat, mean *Mat, flags CovarFlags, ctype MatType)
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 ¶
func Invert(src Mat, dst *Mat, flags SolveDecompositionFlags) float64
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 KMeans ¶
func KMeans(data Mat, k int, bestLabels *Mat, criteria TermCriteria, attempts int, flags KMeansFlags, centers *Mat) float64
KMeans finds centers of clusters and groups input samples around the clusters.
For further details, please see: https://docs.opencv.org/master/d5/d38/group__core__cluster.html#ga9a34dc06c6ec9460e90860f15bcd2f88
func KMeansPoints ¶
func KMeansPoints(points PointVector, k int, bestLabels *Mat, criteria TermCriteria, attempts int, flags KMeansFlags, centers *Mat) float64
KMeansPoints finds centers of clusters and groups input samples around the clusters.
For further details, please see: https://docs.opencv.org/master/d5/d38/group__core__cluster.html#ga9a34dc06c6ec9460e90860f15bcd2f88
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 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 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 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 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 MixChannels ¶
Copies specified channels from input arrays to the specified channels of output arrays.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga51d768c270a1cdd3497255017c4504be
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 MultiplyWithParams ¶
MultiplyWithParams 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 NormWithMats ¶
Norm calculates the absolute difference/relative norm of two arrays.
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 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 RandN ¶
RandN Fills the array with normally distributed random numbers.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaeff1f61e972d133a04ce3a5f81cf6808
func RandShuffle ¶
func RandShuffle(mat *Mat)
RandShuffle Shuffles the array elements randomly.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6a789c8a5cb56c6dd62506179808f763
func RandShuffleWithParams ¶
RandShuffleWithParams Shuffles the array elements randomly.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6a789c8a5cb56c6dd62506179808f763
func RandU ¶
RandU Generates a single uniformly-distributed random number or an array of random numbers.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga1ba1026dca0807b27057ba6a49d258c0
func Reduce ¶
func Reduce(src Mat, dst *Mat, dim int, rType ReduceTypes, dType MatType)
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 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 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 SetIdentity ¶
SetIdentity initializes a scaled identity matrix. For further details, please see:
https://docs.opencv.org/master/d2/de8/group__core__array.html#ga388d7575224a4a277ceb98ccaa327c99
func SetRNGSeed ¶
func SetRNGSeed(seed int)
TheRNG Sets state of default random number generator.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga757e657c037410d9e19e819569e7de0f
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 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 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 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
Types ¶
type ColorConversionCode ¶
type ColorConversionCode int
const ( // ColorBGRToRGBA converts from BGR to RGB with alpha channel. ColorBGRToRGBA ColorConversionCode = 2 // ColorRGBAToBGR converts from RGB with alpha to BGR color space. ColorRGBAToBGR ColorConversionCode = 3 // ColorBGRAToRGBA converts from BGR with alpha channel // to RGB with alpha channel. ColorBGRAToRGBA ColorConversionCode = 5 )
type CompareType ¶
type CompareType int
CompareType is used for Compare operations to indicate which kind of comparison to use.
const ( // CompareEQ src1 is equal to src2. CompareEQ CompareType = 0 // CompareGT src1 is greater than src2. CompareGT CompareType = 1 // CompareGE src1 is greater than or equal to src2. CompareGE CompareType = 2 // CompareLT src1 is less than src2. CompareLT CompareType = 3 // CompareLE src1 is less than or equal to src2. CompareLE CompareType = 4 // CompareNE src1 is unequal to src2. CompareNE CompareType = 5 )
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
const ( // CovarScrambled indicates to scramble the results. CovarScrambled CovarFlags = 0 // CovarNormal indicates to use normal covariation. CovarNormal CovarFlags = 1 // CovarUseAvg indicates to use average covariation. CovarUseAvg CovarFlags = 2 // CovarScale indicates to use scaled covariation. CovarScale CovarFlags = 4 // CovarRows indicates to use covariation on rows. CovarRows CovarFlags = 8 // CovarCols indicates to use covariation on columns. CovarCols CovarFlags = 16 )
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
const ( // DftForward performs forward 1D or 2D dft or dct. DftForward DftFlags = 0 // DftInverse performs an inverse 1D or 2D transform. DftInverse DftFlags = 1 // DftScale scales the result: divide it by the number of array elements. Normally, it is combined with DFT_INVERSE. DftScale DftFlags = 2 // DftRows performs a forward or inverse transform of every individual row of the input matrix. DftRows DftFlags = 4 // DftComplexOutput performs a forward transformation of 1D or 2D real array; the result, though being a complex array, has complex-conjugate symmetry DftComplexOutput DftFlags = 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 DftFlags = 32 // DftComplexInput specifies that input is complex input. If this flag is set, the input must have 2 channels. DftComplexInput DftFlags = 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 )
type KMeansFlags ¶
type KMeansFlags int
KMeansFlags for kmeans center selection
For further details, please see: https://docs.opencv.org/master/d0/de1/group__core.html#ga276000efe55ee2756e0c471c7b270949
const ( // KMeansRandomCenters selects random initial centers in each attempt. KMeansRandomCenters KMeansFlags = 0 // KMeansPPCenters uses kmeans++ center initialization by Arthur and Vassilvitskii [Arthur2007]. KMeansPPCenters KMeansFlags = 1 // KMeansUseInitialLabels uses the user-supplied lables during the first (and possibly the only) attempt // instead of computing them from the initial centers. For the second and further attempts, use the random or semi-random // centers. Use one of KMEANS_*_CENTERS flag to specify the exact method. KMeansUseInitialLabels KMeansFlags = 2 )
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 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 EstimateAffinePartial2DWithParams ¶
func EstimateAffinePartial2DWithParams(from Point2fVector, to Point2fVector, inliers Mat, method int, ransacReprojThreshold float64, maxIters uint, confidence float64, refineIters uint) Mat
EstimateAffinePartial2D computes an optimal limited affine transformation with 4 degrees of freedom between two 2D point sets.
For further details, please see: https://docs.opencv.org/master/d9/d0c/group__calib3d.html#gad767faff73e9cbd8b9d92b955b50062d
Add more parameters to original gocv EstimateAffinePartial2D()
func Eye ¶
Returns an identity matrix of the specified size and type.
The method returns a Matlab-style identity matrix initializer, similarly to Mat::zeros. Similarly to Mat::ones. For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a2cf9b9acde7a9852542bbc20ef851ed2
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 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 NewMatWithSizes ¶
NewMatWithSizes returns a new multidimensional Mat with a specific size and type.
func NewMatWithSizesFromBytes ¶
NewMatWithSizesWithScalar returns a new multidimensional Mat with a specific size, type and preexisting data.
func NewMatWithSizesWithScalar ¶
NewMatWithSizesWithScalar returns a new multidimensional Mat with a specific size, type and scalar value.
func Ones ¶
Returns an array of all 1's of the specified size and type.
The method returns a Matlab-style 1's array initializer For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09
func Split ¶
Split creates an array of single channel images from a multi-channel image Created images should be closed manualy to avoid memory leaks.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga0547c7fed86152d7e9d0096029c8518a
func Zeros ¶
Returns a zero array of the specified size and type.
The method returns a Matlab-style zero array initializer. For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a0b57b6a326c8876d944d188a46e0f556
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) ColRange ¶
ColRange creates a matrix header for the specified column span.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aadc8f9210fe4dec50513746c246fa8d9
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) ConvertToWithParams ¶
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) GetVecbAt ¶
GetVecbAt returns a vector of bytes. Its size corresponds to the number of channels of the Mat.
func (*Mat) GetVecdAt ¶
GetVecdAt returns a vector of float64s. Its size corresponds to the number of channels of the Mat.
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) IsContinuous ¶
IsContinuous determines if the Mat is continuous.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa90cea495029c7d1ee0a41361ccecdf3
func (*Mat) Mean ¶
Mean calculates the mean value M of array elements, independently for each channel, and return it as Scalar For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga191389f8a0e58180bb13a727782cd461
func (*Mat) MeanWithMask ¶
MeanWithMask calculates the mean value M of array elements,independently for each channel, and returns it as Scalar vector while applying the mask. https://docs.opencv.org/master/d2/de8/group__core__array.html#ga191389f8a0e58180bb13a727782cd461
func (*Mat) MultiplyFloat ¶
MultiplyFloat multiplies each element in the Mat by a float value. Performs a mat *= val operation.
func (*Mat) MultiplyMatrix ¶
MultiplyMatrix multiplies matrix (m*x)
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) RowRange ¶
RowRange creates a matrix header for the specified row span.
For further details, please see: https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa6542193430356ad631a9beabc624107
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) T ¶
T transpose matrix https://docs.opencv.org/4.1.2/d3/d63/classcv_1_1Mat.html#aaa428c60ccb6d8ea5de18f63dfac8e11
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 NativeByteBuffer ¶
type NativeByteBuffer struct {
// contains filtered or unexported fields
}
func (*NativeByteBuffer) Close ¶
func (buffer *NativeByteBuffer) Close()
Close the buffer releasing all its resources
func (*NativeByteBuffer) GetBytes ¶
func (buffer *NativeByteBuffer) GetBytes() []byte
GetBytes returns slice of bytes backed by native buffer
func (*NativeByteBuffer) Len ¶
func (buffer *NativeByteBuffer) Len() int
Len - returns length in bytes of underlying buffer
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
const ( // NormInf indicates use infinite normalization. NormInf NormType = 1 // NormL1 indicates use L1 normalization. NormL1 NormType = 2 // NormL2 indicates use L2 normalization. NormL2 NormType = 4 // NormL2Sqr indicates use L2 squared normalization. NormL2Sqr NormType = 5 // NormHamming indicates use Hamming normalization. NormHamming NormType = 6 // NormHamming2 indicates use Hamming 2-bit normalization. NormHamming2 NormType = 7 // NormTypeMask indicates use type mask for normalization. NormTypeMask NormType = 7 // NormRelative indicates use relative normalization. NormRelative NormType = 8 // NormMinMax indicates use min/max normalization. NormMinMax NormType = 32 )
type Point2f ¶
func NewPoint2f ¶
type Point2fVector ¶
type Point2fVector struct {
// contains filtered or unexported fields
}
Point2fVector is a wrapper around a std::vector< cv::Point2f >* This is needed anytime that you need to pass or receive a collection of points.
func NewPoint2fVector ¶
func NewPoint2fVector() Point2fVector
NewPoint2fVector returns a new empty Point2fVector.
func NewPoint2fVectorFromMat ¶
func NewPoint2fVectorFromMat(mat Mat) Point2fVector
NewPoint2fVectorFromMat returns a new Point2fVector that has been wrapped around a Mat of type CV_32FC2 with a single columm.
func NewPoint2fVectorFromPoints ¶
func NewPoint2fVectorFromPoints(pts []Point2f) Point2fVector
NewPoint2fVectorFromPoints returns a new Point2fVector that has been initialized to a slice of image.Point.
func (Point2fVector) Close ¶
func (pfv Point2fVector) Close()
Close closes and frees memory for this Point2fVector.
func (Point2fVector) IsNil ¶
func (pfv Point2fVector) IsNil() bool
IsNil checks the CGo pointer in the Point2fVector.
func (Point2fVector) Size ¶
func (pfv Point2fVector) Size() int
Size returns how many Point are in the PointVector.
func (Point2fVector) ToPoints ¶
func (pfv Point2fVector) ToPoints() []Point2f
ToPoints returns a slice of image.Point for the data in this PointVector.
type Point3f ¶
func NewPoint3f ¶
type Point3fVector ¶
type Point3fVector struct {
// contains filtered or unexported fields
}
Point3fVector is a wrapper around a std::vector< cv::Point3f >*
func NewPoint3fVector ¶
func NewPoint3fVector() Point3fVector
NewPoint3fVector returns a new empty Point3fVector.
func NewPoint3fVectorFromMat ¶
func NewPoint3fVectorFromMat(mat Mat) Point3fVector
NewPoint3fVectorFromMat returns a new Point3fVector that has been wrapped around a Mat of type CV_32FC3 with a single columm.
func NewPoint3fVectorFromPoints ¶
func NewPoint3fVectorFromPoints(pts []Point3f) Point3fVector
NewPoint3fVectorFromPoints returns a new Point3fVector that has been initialized to a slice of image.Point.
func (Point3fVector) Append ¶
func (pfv Point3fVector) Append(point Point3f)
func (Point3fVector) Close ¶
func (pfv Point3fVector) Close()
Close closes and frees memory for this Point3fVector.
func (Point3fVector) IsNil ¶
func (pfv Point3fVector) IsNil() bool
IsNil checks the CGo pointer in the Point3fVector.
func (Point3fVector) Size ¶
func (pfv Point3fVector) Size() int
Size returns how many Point are in the Point3fVector.
func (Point3fVector) ToPoints ¶
func (pfv Point3fVector) ToPoints() []Point3f
ToPoints returns a slice of Point3f for the data in this Point3fVector.
type PointVector ¶
type PointVector struct {
// contains filtered or unexported fields
}
PointVector is a wrapper around a std::vector< cv::Point >* This is needed anytime that you need to pass or receive a collection of points.
func NewPointVector ¶
func NewPointVector() PointVector
NewPointVector returns a new empty PointVector.
func NewPointVectorFromMat ¶
func NewPointVectorFromMat(mat Mat) PointVector
NewPointVectorFromMat returns a new PointVector that has been wrapped around a Mat of type CV_32SC2 with a single columm.
func NewPointVectorFromPoints ¶
func NewPointVectorFromPoints(pts []image.Point) PointVector
NewPointVectorFromPoints returns a new PointVector that has been initialized to a slice of image.Point.
func (PointVector) Append ¶
func (pv PointVector) Append(point image.Point)
Append appends an image.Point at end of the PointVector.
func (PointVector) Close ¶
func (pv PointVector) Close()
Close closes and frees memory for this PointVector.
func (PointVector) IsNil ¶
func (pv PointVector) IsNil() bool
IsNil checks the CGo pointer in the PointVector.
func (PointVector) Size ¶
func (pv PointVector) Size() int
Size returns how many Point are in the PointVector.
func (PointVector) ToPoints ¶
func (pv PointVector) ToPoints() []image.Point
ToPoints returns a slice of image.Point for the data in this PointVector.
type Points2fVector ¶
type Points2fVector struct {
// contains filtered or unexported fields
}
Points2fVector is a wrapper around a std::vector< std::vector< cv::Point2f > >*
func NewPoints2fVector ¶
func NewPoints2fVector() Points2fVector
NewPoints2fVector returns a new empty Points2fVector.
func NewPoints2fVectorFromPoints ¶
func NewPoints2fVectorFromPoints(pts [][]Point2f) Points2fVector
NewPoints2fVectorFromPoints returns a new Points2fVector that has been initialized to a slice of slices of Point2f.
func (Points2fVector) Append ¶
func (pvs Points2fVector) Append(pv Point2fVector)
Append appends a Point2fVector at end of the Points2fVector.
func (Points2fVector) At ¶
func (pvs Points2fVector) At(idx int) Point2fVector
At returns the Point2fVector at that index of the Points2fVector.
func (Points2fVector) Close ¶
func (pvs Points2fVector) Close()
Close closes and frees memory for this Points2fVector.
func (Points2fVector) IsNil ¶
func (pvs Points2fVector) IsNil() bool
IsNil checks the CGo pointer in the Points2fVector.
func (Points2fVector) P ¶
func (pvs Points2fVector) P() C.Points2fVector
func (Points2fVector) Size ¶
func (pvs Points2fVector) Size() int
Size returns how many vectors of Points are in the Points2fVector.
func (Points2fVector) ToPoints ¶
func (pvs Points2fVector) ToPoints() [][]Point2f
ToPoints returns a slice of slices of Point2f for the data in this Points2fVector.
type Points3fVector ¶
type Points3fVector struct {
// contains filtered or unexported fields
}
Points3fVector is a wrapper around a std::vector< std::vector< cv::Point3f > >*
func NewPoints3fVector ¶
func NewPoints3fVector() Points3fVector
NewPoints3fVector returns a new empty Points3fVector.
func NewPoints3fVectorFromPoints ¶
func NewPoints3fVectorFromPoints(pts [][]Point3f) Points3fVector
NewPoints3fVectorFromPoints returns a new Points3fVector that has been initialized to a slice of slices of Point3f.
func (Points3fVector) Append ¶
func (pvs Points3fVector) Append(pv Point3fVector)
Append appends a Point3fVector at end of the Points3fVector.
func (Points3fVector) At ¶
func (pvs Points3fVector) At(idx int) Point3fVector
At returns the Point3fVector at that index of the Points3fVector.
func (Points3fVector) Close ¶
func (pvs Points3fVector) Close()
Close closes and frees memory for this Points3fVector.
func (Points3fVector) IsNil ¶
func (pvs Points3fVector) IsNil() bool
IsNil checks the CGo pointer in the Points3fVector.
func (Points3fVector) Size ¶
func (pvs Points3fVector) Size() int
Size returns how many vectors of Points are in the Points3fVector.
func (Points3fVector) ToPoints ¶
func (pvs Points3fVector) ToPoints() [][]Point3f
ToPoints returns a slice of slices of Point3f for the data in this Points3fVector.
type PointsVector ¶
type PointsVector struct {
// contains filtered or unexported fields
}
PointsVector is a wrapper around a std::vector< std::vector< cv::Point > >*
func NewPointsVector ¶
func NewPointsVector() PointsVector
NewPointsVector returns a new empty PointsVector.
func NewPointsVectorFromPoints ¶
func NewPointsVectorFromPoints(pts [][]image.Point) PointsVector
NewPointsVectorFromPoints returns a new PointsVector that has been initialized to a slice of slices of image.Point.
func (PointsVector) Append ¶
func (pvs PointsVector) Append(pv PointVector)
Append appends a PointVector at end of the PointsVector.
func (PointsVector) At ¶
func (pvs PointsVector) At(idx int) PointVector
At returns the PointVector at that index of the PointsVector.
func (PointsVector) Close ¶
func (pvs PointsVector) Close()
Close closes and frees memory for this PointsVector.
func (PointsVector) IsNil ¶
func (pvs PointsVector) IsNil() bool
IsNil checks the CGo pointer in the PointsVector.
func (PointsVector) P ¶
func (pvs PointsVector) P() C.PointsVector
func (PointsVector) Size ¶
func (pvs PointsVector) Size() int
Size returns how many vectors of Points are in the PointsVector.
func (PointsVector) ToPoints ¶
func (pvs PointsVector) ToPoints() [][]image.Point
ToPoints returns a slice of slices of image.Point for the data in this PointsVector.
type RNG ¶
type RNG struct {
// contains filtered or unexported fields
}
RNG Random Number Generator. It encapsulates the state (currently, a 64-bit integer) and has methods to return scalar random values and to fill arrays with random values
For further details, please see: https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html
func TheRNG ¶
func TheRNG() RNG
TheRNG Returns the default random number generator.
For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga75843061d150ad6564b5447e38e57722
func (*RNG) Fill ¶
func (r *RNG) Fill(mat *Mat, distType RNGDistType, a, b float64, saturateRange bool)
Fill Fills arrays with random numbers.
For further details, please see: https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html#ad26f2b09d9868cf108e84c9814aa682d
func (*RNG) Gaussian ¶
Gaussian Returns the next random number sampled from the Gaussian distribution.
For further details, please see: https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html#a8df8ce4dc7d15916cee743e5a884639d
func (*RNG) Next ¶
Next The method updates the state using the MWC algorithm and returns the next 32-bit random number.
For further details, please see: https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html#a8df8ce4dc7d15916cee743e5a884639d
type RNGDistType ¶
type RNGDistType int
const ( // Uniform distribution RNGDistUniform RNGDistType = 0 // Normal distribution RNGDistNormal RNGDistType = 1 )
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 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
const ( // Rotate90Clockwise allows to rotate image 90 degrees clockwise Rotate90Clockwise RotateFlag = 0 // Rotate180Clockwise allows to rotate image 180 degrees clockwise Rotate180Clockwise RotateFlag = 1 // Rotate90CounterClockwise allows to rotate 270 degrees clockwise Rotate90CounterClockwise RotateFlag = 2 )
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 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 SolveDecompositionFlags ¶
type SolveDecompositionFlags int
const ( // Gaussian elimination with the optimal pivot element chosen. SolveDecompositionLu SolveDecompositionFlags = 0 // Singular value decomposition (SVD) method. The system can be over-defined and/or the matrix src1 can be singular. SolveDecompositionSvd SolveDecompositionFlags = 1 // Eigenvalue decomposition. The matrix src1 must be symmetrical. SolveDecompositionEing SolveDecompositionFlags = 2 // Cholesky LL^T factorization. The matrix src1 must be symmetrical and positively defined. SolveDecompositionCholesky SolveDecompositionFlags = 3 // QR factorization. The system can be over-defined and/or the matrix src1 can be singular. SolveDecompositionQr SolveDecompositionFlags = 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 SolveDecompositionFlags = 5 )
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 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
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 TermCriteriaType = 1 // EPS is the desired accuracy or change in parameters at which the // iterative algorithm stops. EPS TermCriteriaType = 2 )