gocvx

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

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

View Source
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
)
View Source
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

View Source
var ErrEmptyByteSlice = errors.New("empty byte array")

Functions

func AbsDiff

func AbsDiff(src1, src2 Mat, dst *Mat)

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

func Add(src1, src2 Mat, dst *Mat)

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

func AddWeighted(src1 Mat, alpha float64, src2 Mat, beta float64, gamma float64, dst *Mat)

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

func BitwiseAnd(src1 Mat, src2 Mat, dst *Mat)

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

func BitwiseAndWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat)

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

func BitwiseNot(src1 Mat, dst *Mat)

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

func BitwiseNotWithMask(src1 Mat, dst *Mat, mask Mat)

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

func BitwiseOr(src1 Mat, src2 Mat, dst *Mat)

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

func BitwiseOrWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat)

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

func BitwiseXor(src1 Mat, src2 Mat, dst *Mat)

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

func BitwiseXorWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat)

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

func CartToPolar(x Mat, y Mat, magnitude *Mat, angle *Mat, angleInDegrees bool)

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

func CheckRange(src Mat) bool

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

func CompleteSymm(m Mat, lowerToUpper bool)

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

func ConvertScaleAbs(src Mat, dst *Mat, alpha float64, beta float64)

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

func CountNonZero(src Mat) int

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

func DCT(src Mat, dst *Mat, flags DftFlags)

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

func DFT(src Mat, dst *Mat, flags DftFlags)

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

func Determinant(src Mat) float64

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

func Divide(src1 Mat, src2 Mat, dst *Mat)

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

func Eigen(src Mat, eigenvalues *Mat, eigenvectors *Mat) bool

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

func EigenNonSymmetric(src Mat, eigenvalues *Mat, eigenvectors *Mat)

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

func Exp(src Mat, dst *Mat)

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

func ExtractChannel(src Mat, dst *Mat, coi int)

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

func FindNonZero(src Mat, idx *Mat)

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

func Flip(src Mat, dst *Mat, flipCode int)

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

func Gemm(src1, src2 Mat, alpha float64, src3 Mat, beta float64, dst *Mat, flags int)

Gemm performs generalized matrix multiplication.

For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gacb6e64071dffe36434e1e7ee79e7cb35

func GetOptimalDFTSize

func GetOptimalDFTSize(vecsize int) int

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

func Hconcat(src1, src2 Mat, dst *Mat)

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

func IDCT(src Mat, dst *Mat, flags int)

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

func IDFT(src Mat, dst *Mat, flags, nonzeroRows int)

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

func InRange(src, lb, ub Mat, dst *Mat)

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

func InRangeWithScalar(src Mat, lb, ub Scalar, dst *Mat)

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

func InsertChannel(src Mat, dst *Mat, coi int)

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

func LUT(src, wbLUT Mat, dst *Mat)

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

func Log(src Mat, dst *Mat)

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

func Magnitude(x, y Mat, magnitude *Mat)

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

func Max(src1, src2 Mat, dst *Mat)

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

func MeanStdDev(src Mat, dst *Mat, dstStdDev *Mat)

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

func Merge(mv []Mat, dst *Mat)

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

func Min(src1, src2 Mat, dst *Mat)

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

func MinMaxIdx(input Mat) (minVal, maxVal float32, minIdx, maxIdx int)

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

func MinMaxLoc(input Mat) (minVal, maxVal float32, minLoc, maxLoc image.Point)

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

func MixChannels(src []Mat, dst []Mat, fromTo []int)

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

func MulSpectrums(a Mat, b Mat, dst *Mat, flags DftFlags)

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

func Multiply(src1 Mat, src2 Mat, dst *Mat)

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

func MultiplyWithParams(src1 Mat, src2 Mat, dst *Mat, scale float64, dtype MatType)

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

func Norm(src1 Mat, normType NormType) float64

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

func NormWithMats(src1 Mat, src2 Mat, normType NormType) float64

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

func Normalize(src Mat, dst *Mat, alpha float64, beta float64, typ NormType)

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

func PerspectiveTransform(src Mat, dst *Mat, tm Mat)

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

func Phase(x, y Mat, angle *Mat, angleInDegrees bool)

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

func PolarToCart(magnitude Mat, degree Mat, x *Mat, y *Mat, angleInDegrees bool)

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

func Pow(src Mat, power float64, dst *Mat)

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

func RandN(mat *Mat, mean, stddev Scalar)

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

func RandShuffleWithParams(mat *Mat, iterFactor float64, rng RNG)

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

func RandU(mat *Mat, low, high Scalar)

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

func Repeat(src Mat, nY int, nX int, dst *Mat)

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

func ScaleAdd(src1 Mat, alpha float64, src2 Mat, dst *Mat)

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

func SetIdentity(src Mat, scalar float64)

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

func SolveCubic(coeffs Mat, roots *Mat) int

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

func SolvePoly(coeffs Mat, roots *Mat, maxIters int) float64

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

func Sort(src Mat, dst *Mat, flags SortFlags)

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

func SortIdx(src Mat, dst *Mat, flags SortFlags)

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

func Subtract(src1 Mat, src2 Mat, dst *Mat)

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

func Transform(src Mat, dst *Mat, tm Mat)

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

func Transpose(src Mat, dst *Mat)

Transpose transposes a matrix.

For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga46630ed6c0ea6254a35f447289bd7404

func Vconcat

func Vconcat(src1, src2 Mat, dst *Mat)

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

func WarpAffine(src Mat, dst *Mat, m Mat, sz image.Point)

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

type DMatch struct {
	QueryIdx int
	TrainIdx int
	ImgIdx   int
	Distance float64
}

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

type KeyPoint struct {
	X, Y                  float64
	Size, Angle, Response float64
	Octave, ClassID       int
}

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

func Eye(rows int, cols int, mt MatType) Mat

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

func ImageToMatRGB(img image.Image) (Mat, error)

ImageToMatRGB converts image.Image to gocv.Mat, which represents RGB image having 8bit for each component. Type of Mat is gocv.MatTypeCV8UC3.

func NewMat

func NewMat() Mat

NewMat returns a new empty Mat.

func NewMatFromBytes

func NewMatFromBytes(rows int, cols int, mt MatType, data []byte) (Mat, error)

NewMatFromBytes returns a new Mat with a specific size and type, initialized from a []byte.

func NewMatFromScalar

func NewMatFromScalar(s Scalar, mt MatType) Mat

NewMatFromScalar returns a new Mat for a specific Scalar value

func NewMatWithSize

func NewMatWithSize(rows int, cols int, mt MatType) Mat

NewMatWithSize returns a new Mat with a specific size and type.

func NewMatWithSizeFromScalar

func NewMatWithSizeFromScalar(s Scalar, rows int, cols int, mt MatType) Mat

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

func NewMatWithSizes(sizes []int, mt MatType) Mat

NewMatWithSizes returns a new multidimensional Mat with a specific size and type.

func NewMatWithSizesFromBytes

func NewMatWithSizesFromBytes(sizes []int, mt MatType, data []byte) (Mat, error)

NewMatWithSizesWithScalar returns a new multidimensional Mat with a specific size, type and preexisting data.

func NewMatWithSizesWithScalar

func NewMatWithSizesWithScalar(sizes []int, mt MatType, s Scalar) Mat

NewMatWithSizesWithScalar returns a new multidimensional Mat with a specific size, type and scalar value.

func Ones

func Ones(rows int, cols int, mt MatType) Mat

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

func Split(src Mat) (mv []Mat)

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

func Zeros(rows int, cols int, mt MatType) Mat

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

func (m *Mat) AddFloat(val float32)

AddFloat adds a float value to each element in the Mat. Performs a mat += val operation.

func (*Mat) AddUChar

func (m *Mat) AddUChar(val uint8)

AddUChar adds a uchar value to each element in the Mat. Performs a mat += val operation.

func (*Mat) Channels

func (m *Mat) Channels() int

Channels returns the number of channels for this Mat.

func (*Mat) Clone

func (m *Mat) Clone() Mat

Clone returns a cloned full copy of the Mat.

func (*Mat) Close

func (m *Mat) Close() error

Close the Mat object.

func (*Mat) ColRange

func (m *Mat) ColRange(start, end int) Mat

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) Cols

func (m *Mat) Cols() int

Cols returns the number of columns for this Mat.

func (*Mat) ConvertFp16

func (m *Mat) ConvertFp16() Mat

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

func (m *Mat) ConvertTo(dst *Mat, mt MatType)

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 (m *Mat) ConvertToWithParams(dst *Mat, mt MatType, alpha, beta float32)

func (*Mat) CopyTo

func (m *Mat) CopyTo(dst *Mat)

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

func (m *Mat) CopyToWithMask(dst *Mat, mask Mat)

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

func (m *Mat) DataPtrFloat32() ([]float32, error)

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

func (m *Mat) DataPtrFloat64() ([]float64, error)

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

func (m *Mat) DataPtrInt16() ([]int16, error)

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

func (m *Mat) DataPtrInt8() ([]int8, error)

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

func (m *Mat) DataPtrUint16() ([]uint16, error)

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

func (m *Mat) DataPtrUint8() ([]uint8, error)

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

func (m *Mat) DivideFloat(val float32)

DivideFloat divides each element in the Mat by a float value. Performs a mat /= val operation.

func (*Mat) DivideUChar

func (m *Mat) DivideUChar(val uint8)

DivideUChar divides each element in the Mat by a uint value. Performs a mat /= val operation.

func (*Mat) Empty

func (m *Mat) Empty() bool

Empty determines if the Mat is empty or not.

func (*Mat) FromPtr

func (m *Mat) FromPtr(rows int, cols int, mt MatType, prow int, pcol int) (Mat, error)

FromPtr returns a new Mat with a specific size and type, initialized from a Mat Ptr.

func (*Mat) GetDoubleAt

func (m *Mat) GetDoubleAt(row int, col int) float64

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

func (m *Mat) GetDoubleAt3(x, y, z int) float64

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

func (m *Mat) GetFloatAt(row int, col int) float32

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

func (m *Mat) GetFloatAt3(x, y, z int) float32

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

func (m *Mat) GetIntAt(row int, col int) int32

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

func (m *Mat) GetIntAt3(x, y, z int) int32

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

func (m *Mat) GetSCharAt(row int, col int) int8

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

func (m *Mat) GetSCharAt3(x, y, z int) int8

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

func (m *Mat) GetShortAt(row int, col int) int16

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

func (m *Mat) GetShortAt3(x, y, z int) int16

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

func (m *Mat) GetUCharAt(row int, col int) uint8

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

func (m *Mat) GetUCharAt3(x, y, z int) uint8

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

func (m *Mat) GetVecbAt(row int, col int) Vecb

GetVecbAt returns a vector of bytes. Its size corresponds to the number of channels of the Mat.

func (*Mat) GetVecdAt

func (m *Mat) GetVecdAt(row int, col int) Vecd

GetVecdAt returns a vector of float64s. Its size corresponds to the number of channels of the Mat.

func (*Mat) GetVecfAt

func (m *Mat) GetVecfAt(row int, col int) Vecf

GetVecfAt returns a vector of floats. Its size corresponds to the number of channels of the Mat.

func (*Mat) GetVeciAt

func (m *Mat) GetVeciAt(row int, col int) Veci

GetVeciAt returns a vector of integers. Its size corresponds to the number of channels of the Mat.

func (*Mat) IsContinuous

func (m *Mat) IsContinuous() bool

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

func (m *Mat) Mean() Scalar

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

func (m *Mat) MeanWithMask(mask Mat) Scalar

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

func (m *Mat) MultiplyFloat(val float32)

MultiplyFloat multiplies each element in the Mat by a float value. Performs a mat *= val operation.

func (*Mat) MultiplyMatrix

func (m *Mat) MultiplyMatrix(x Mat) Mat

MultiplyMatrix multiplies matrix (m*x)

func (*Mat) MultiplyUChar

func (m *Mat) MultiplyUChar(val uint8)

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) Ptr

func (m *Mat) Ptr() C.Mat

Ptr returns the Mat's underlying object pointer.

func (*Mat) Region

func (m *Mat) Region(rio image.Rectangle) Mat

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

func (m *Mat) Reshape(cn int, rows int) Mat

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

func (m *Mat) RowRange(start, end int) Mat

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) Rows

func (m *Mat) Rows() int

Rows returns the number of rows for this Mat.

func (*Mat) SetDoubleAt

func (m *Mat) SetDoubleAt(row int, col int, val float64)

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

func (m *Mat) SetDoubleAt3(x, y, z int, val float64)

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

func (m *Mat) SetFloatAt(row int, col int, val float32)

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

func (m *Mat) SetFloatAt3(x, y, z int, val float32)

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

func (m *Mat) SetIntAt(row int, col int, val int32)

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

func (m *Mat) SetIntAt3(x, y, z int, val int32)

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

func (m *Mat) SetSCharAt(row int, col int, val int8)

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

func (m *Mat) SetSCharAt3(x, y, z int, val int8)

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

func (m *Mat) SetShortAt(row int, col int, val int16)

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

func (m *Mat) SetShortAt3(x, y, z int, val int16)

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) SetTo

func (m *Mat) SetTo(s Scalar)

SetTo sets all or some of the array elements to the specified scalar value.

func (*Mat) SetUCharAt

func (m *Mat) SetUCharAt(row int, col int, val uint8)

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

func (m *Mat) SetUCharAt3(x, y, z int, val uint8)

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

func (m *Mat) Size() (dims []int)

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

func (m *Mat) Sqrt() Mat

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) Step

func (m *Mat) Step() int

Step returns the number of bytes each matrix row occupies.

func (*Mat) SubtractFloat

func (m *Mat) SubtractFloat(val float32)

SubtractFloat subtracts a float value from each element in the Mat. Performs a mat -= val operation.

func (*Mat) SubtractUChar

func (m *Mat) SubtractUChar(val uint8)

SubtractUChar subtracts a uchar value from each element in the Mat. Performs a mat -= val operation.

func (*Mat) Sum

func (m *Mat) Sum() Scalar

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

func (m *Mat) ToBytes() []byte

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) ToImage

func (m *Mat) ToImage() (image.Image, error)

ToImage converts a Mat to a image.Image.

func (*Mat) Total

func (m *Mat) Total() int

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

func (*Mat) Type

func (m *Mat) Type() MatType

Type returns the type for this Mat.

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

type Point2f struct {
	X float32
	Y float32
}

func NewPoint2f

func NewPoint2f(x, y float32) Point2f

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) At

func (pfv Point2fVector) At(idx int) Point2f

At returns the 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

type Point3f struct {
	X float32
	Y float32
	Z float32
}

func NewPoint3f

func NewPoint3f(x, y, z float32) Point3f

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) At

func (pfv Point3fVector) At(idx int) Point3f

At returns the 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) At

func (pv PointVector) At(idx int) image.Point

At returns the image.Point

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 (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

func (r *RNG) Gaussian(sigma float64) float64

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

func (r *RNG) Next() uint

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

type Scalar struct {
	Val1 float64
	Val2 float64
	Val3 float64
	Val4 float64
}

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

func NewScalar(v1 float64, v2 float64, v3 float64, v4 float64) Scalar

NewScalar returns a new Scalar. These are usually colors typically being in BGR order.

func Trace

func Trace(src Mat) Scalar

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
)

type Vecb

type Vecb []uint8

Vecb is a generic vector of bytes.

type Vecd

type Vecd []float64

Vecd is a generic vector of float64/doubles.

type Vecf

type Vecf []float32

Vecf is a generic vector of floats.

type Veci

type Veci []int32

Veci is a generic vector of integers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL