gocv: gocv.io/x/gocv/contrib Index | Files

package contrib

import "gocv.io/x/gocv/contrib"

Package contrib is the GoCV wrapper around OpenCV Contrib.

For further details, please see: https://github.com/opencv/opencv_contrib

Index

Package Files

cgo.go contrib.go face.go img_hash.go tracking.go xfeatures2d.go

type AverageHash Uses

type AverageHash struct{}

AverageHash is implementation of the AverageHash algorithm.

func (AverageHash) Compare Uses

func (hash AverageHash) Compare(a, b gocv.Mat) float64

Compare compares the hash value between a and b using AverageHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5

func (AverageHash) Compute Uses

func (hash AverageHash) Compute(input gocv.Mat, output *gocv.Mat)

Compute computes hash of the input image using AverageHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3

type BlockMeanHash Uses

type BlockMeanHash struct {
    Mode BlockMeanHashMode
}

BlockMeanHash is implementation of the BlockMeanHash algorithm.

func (BlockMeanHash) Compare Uses

func (hash BlockMeanHash) Compare(a, b gocv.Mat) float64

Compare compares the hash value between a and b using BlockMeanHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5

func (BlockMeanHash) Compute Uses

func (hash BlockMeanHash) Compute(input gocv.Mat, output *gocv.Mat)

Compute computes hash of the input image using BlockMeanHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3

type BlockMeanHashMode Uses

type BlockMeanHashMode int
const (
    BlockMeanHashMode0 BlockMeanHashMode = iota
    BlockMeanHashMode1
    BlockMeanHashModeDefault = BlockMeanHashMode0
)

type ColorMomentHash Uses

type ColorMomentHash struct{}

ColorMomentHash is implementation of the ColorMomentHash algorithm.

func (ColorMomentHash) Compare Uses

func (hash ColorMomentHash) Compare(a, b gocv.Mat) float64

Compare compares the hash value between a and b using ColorMomentHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5

func (ColorMomentHash) Compute Uses

func (hash ColorMomentHash) Compute(input gocv.Mat, output *gocv.Mat)

Compute computes hash of the input image using ColorMomentHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3

type ImgHashBase Uses

type ImgHashBase interface {
    Compare(a, b gocv.Mat) float64
    Compute(inputArr gocv.Mat, outputArr *gocv.Mat)
}

ImgHashBase defines the interface used for all of the img_hash algorithms.

type LBPHFaceRecognizer Uses

type LBPHFaceRecognizer struct {
    // contains filtered or unexported fields
}

LBPHFaceRecognizer is a wrapper for the OpenCV Local Binary Patterns Histograms face recognizer.

func NewLBPHFaceRecognizer Uses

func NewLBPHFaceRecognizer() *LBPHFaceRecognizer

NewLBPHFaceRecognizer creates a new LBPH Recognizer model.

For further information, see: https://docs.opencv.org/master/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html

func (*LBPHFaceRecognizer) GetNeighbors Uses

func (fr *LBPHFaceRecognizer) GetNeighbors() int

GetNeighbors returns the neighbors value of the model.

For further information, see: https://docs.opencv.org/master/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a50a3e2ca6e8464166e153c9df84b0a77

func (*LBPHFaceRecognizer) LoadFile Uses

func (fr *LBPHFaceRecognizer) LoadFile(fname string)

LoadFile loads a trained model data from file.

For further information, see: https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#acc42e5b04595dba71f0777c7179af8c3

func (*LBPHFaceRecognizer) Predict Uses

func (fr *LBPHFaceRecognizer) Predict(sample gocv.Mat) int

Predict predicts a label for a given input image. It returns the label for correctly predicted image or -1 if not found.

For further information, see: https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#aa2d2f02faffab1bf01317ae6502fb631

func (*LBPHFaceRecognizer) PredictExtendedResponse Uses

func (fr *LBPHFaceRecognizer) PredictExtendedResponse(sample gocv.Mat) PredictResponse

PredictExtendedResponse returns a label and associated confidence (e.g. distance) for a given input image. It is the extended version of `Predict()`.

For further information, see: https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ab0d593e53ebd9a0f350c989fcac7f251

func (*LBPHFaceRecognizer) SaveFile Uses

func (fr *LBPHFaceRecognizer) SaveFile(fname string)

SaveFile saves the trained model data to file.

For further information, see: https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a2adf2d555550194244b05c91fefcb4d6

func (*LBPHFaceRecognizer) SetNeighbors Uses

func (fr *LBPHFaceRecognizer) SetNeighbors(neighbors int)

SetNeighbors sets the neighbors value of the model, i.e. the number of sample points to build a Circular Local Binary Pattern from. Note that wrong neighbors can raise OpenCV exception!

For further information, see: https://docs.opencv.org/master/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#ab225f7bf353ce8697a506eda10124a92

func (*LBPHFaceRecognizer) SetRadius Uses

func (fr *LBPHFaceRecognizer) SetRadius(radius int)

SetRadius sets the radius used for building the Circular Local Binary Pattern.

For further information, see: https://docs.opencv.org/master/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a62d94c75cade902fd3b487b1ef9883fc

func (*LBPHFaceRecognizer) SetThreshold Uses

func (fr *LBPHFaceRecognizer) SetThreshold(threshold float32)

SetThreshold sets the threshold value of the model, i.e. the threshold applied in the prediction.

For further information, see: https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a3182081e5f8023e658ad8ab96656dd63

func (*LBPHFaceRecognizer) Train Uses

func (fr *LBPHFaceRecognizer) Train(images []gocv.Mat, labels []int)

Train loaded model with images and their labels

see https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ac8680c2aa9649ad3f55e27761165c0d6

func (*LBPHFaceRecognizer) Update Uses

func (fr *LBPHFaceRecognizer) Update(newImages []gocv.Mat, newLabels []int)

Update updates the existing trained model with new images and labels.

For further information, see: https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a8a4e73ea878dcd0c235d0487189d25f3

type MarrHildrethHash Uses

type MarrHildrethHash struct {
    Alpha float32
    Scale float32
}

MarrHildrethHash is implementation of the MarrHildrethHash algorithm.

func NewMarrHildrethHash Uses

func NewMarrHildrethHash() MarrHildrethHash

func (MarrHildrethHash) Compare Uses

func (hash MarrHildrethHash) Compare(a, b gocv.Mat) float64

Compare compares the hash value between a and b using MarrHildrethHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5

func (MarrHildrethHash) Compute Uses

func (hash MarrHildrethHash) Compute(input gocv.Mat, output *gocv.Mat)

Compute computes hash of the input image using MarrHildrethHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3

type PHash Uses

type PHash struct{}

PHash is implementation of the PHash algorithm.

func (PHash) Compare Uses

func (hash PHash) Compare(a, b gocv.Mat) float64

Compare compares the hash value between a and b using PHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5

func (PHash) Compute Uses

func (hash PHash) Compute(input gocv.Mat, output *gocv.Mat)

Compute computes hash of the input image using PHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3

type PredictResponse Uses

type PredictResponse struct {
    Label      int32   `json:"label"`
    Confidence float32 `json:"confidence"`
}

PredictResponse represents a predicted label and associated confidence.

type RadialVarianceHash Uses

type RadialVarianceHash struct {
    Sigma          float64
    NumOfAngleLine int
}

RadialVarianceHash is implementation of the RadialVarianceHash algorithm.

func NewRadialVarianceHash Uses

func NewRadialVarianceHash() RadialVarianceHash

func (RadialVarianceHash) Compare Uses

func (hash RadialVarianceHash) Compare(a, b gocv.Mat) float64

Compare compares the hash value between a and b using RadialVarianceHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5

func (RadialVarianceHash) Compute Uses

func (hash RadialVarianceHash) Compute(input gocv.Mat, output *gocv.Mat)

Compute computes hash of the input image using RadialVarianceHash.

For further information, see: https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3

type SIFT Uses

type SIFT struct {
    // contains filtered or unexported fields
}

SIFT is a wrapper around the cv::SIFT algorithm. Due to being a patented algorithm you must set the OpenCV contrib build flag OPENCV_ENABLE_NONFREE=1 in order to use it.

func NewSIFT Uses

func NewSIFT() SIFT

NewSIFT returns a new SIFT algorithm.

For further details, please see: https://docs.opencv.org/master/d5/d3c/classcv_1_1xfeatures2d_1_1SIFT.html

func (*SIFT) Close Uses

func (d *SIFT) Close() error

Close SIFT.

func (*SIFT) Detect Uses

func (d *SIFT) Detect(src gocv.Mat) []gocv.KeyPoint

Detect keypoints in an image using SIFT.

For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887

func (*SIFT) DetectAndCompute Uses

func (d *SIFT) DetectAndCompute(src gocv.Mat, mask gocv.Mat) ([]gocv.KeyPoint, gocv.Mat)

DetectAndCompute detects and computes keypoints in an image using SIFT.

For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677

type SURF Uses

type SURF struct {
    // contains filtered or unexported fields
}

SURF is a wrapper around the cv::SURF algorithm. Due to being a patented algorithm you must set the OpenCV contrib build flag OPENCV_ENABLE_NONFREE=1 in order to use it.

func NewSURF Uses

func NewSURF() SURF

NewSURF returns a new SURF algorithm.

For further details, please see: https://docs.opencv.org/master/d5/df7/classcv_1_1xfeatures2d_1_1SURF.html

func (*SURF) Close Uses

func (d *SURF) Close() error

Close SURF.

func (*SURF) Detect Uses

func (d *SURF) Detect(src gocv.Mat) []gocv.KeyPoint

Detect keypoints in an image using SURF.

For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887

func (*SURF) DetectAndCompute Uses

func (d *SURF) DetectAndCompute(src gocv.Mat, mask gocv.Mat) ([]gocv.KeyPoint, gocv.Mat)

DetectAndCompute detects and computes keypoints in an image using SURF.

For further details, please see: https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677

type Tracker Uses

type Tracker interface {
    // Close closes, as Trackers need to be Closed manually.
    //
    Close() error

    // Init initializes the tracker with a known bounding box that surrounded the target.
    // Note: this can only be called once. If you lose the object, you have to Close() the instance,
    // create a new one, and call Init() on it again.
    //
    // see: https://docs.opencv.org/master/d0/d0a/classcv_1_1Tracker.html#a4d285747589b1bdd16d2e4f00c3255dc
    //
    Init(image gocv.Mat, boundingBox image.Rectangle) bool

    // Update updates the tracker, returns a new bounding box and a boolean determining whether the tracker lost the target.
    //
    // see: https://docs.opencv.org/master/d0/d0a/classcv_1_1Tracker.html#a549159bd0553e6a8de356f3866df1f18
    //
    Update(image gocv.Mat) (image.Rectangle, bool)
}

Tracker is the base interface for object tracking.

see: https://docs.opencv.org/master/d0/d0a/classcv_1_1Tracker.html

func NewTrackerBoosting Uses

func NewTrackerBoosting() Tracker

NewTrackerBoosting returns a new TrackerBoosting.

func NewTrackerCSRT Uses

func NewTrackerCSRT() Tracker

NewTrackerCSRT returns a new TrackerCSRT.

func NewTrackerKCF Uses

func NewTrackerKCF() Tracker

NewTrackerKCF returns a new TrackerKCF.

func NewTrackerMIL Uses

func NewTrackerMIL() Tracker

NewTrackerMIL returns a new TrackerMIL.

func NewTrackerMOSSE Uses

func NewTrackerMOSSE() Tracker

NewTrackerMOSSE returns a new TrackerMOSSE.

func NewTrackerMedianFlow Uses

func NewTrackerMedianFlow() Tracker

NewTrackerMedianFlow returns a new TrackerMedianFlow.

func NewTrackerTLD Uses

func NewTrackerTLD() Tracker

NewTrackerTLD returns a new TrackerTLD.

type TrackerBoosting Uses

type TrackerBoosting struct {
    // contains filtered or unexported fields
}

TrackerBoosting is a real-time object tracker based on a novel on-line version of the AdaBoost algorithm.

For further details, please see: https://docs.opencv.org/master/d1/d1a/classcv_1_1TrackerBoosting.html

func (TrackerBoosting) Close Uses

func (trk TrackerBoosting) Close() error

Close closes the TrackerBoosting.

func (TrackerBoosting) Init Uses

func (trk TrackerBoosting) Init(img gocv.Mat, boundingBox image.Rectangle) bool

Init initializes the Tracker.

func (TrackerBoosting) Update Uses

func (trk TrackerBoosting) Update(img gocv.Mat) (image.Rectangle, bool)

Update updates the Tracker.

type TrackerCSRT Uses

type TrackerCSRT struct {
    // contains filtered or unexported fields
}

TrackerCSRT is an implementation of Discriminative Correlation Filter Tracker with Channel and Spatial Reliability.

For further details, please see: https://docs.opencv.org/master/d2/da2/classcv_1_1TrackerCSRT.html

func (TrackerCSRT) Close Uses

func (trk TrackerCSRT) Close() error

Close closes this Tracker.

func (TrackerCSRT) Init Uses

func (trk TrackerCSRT) Init(img gocv.Mat, boundingBox image.Rectangle) bool

Init initializes this Tracker.

func (TrackerCSRT) Update Uses

func (trk TrackerCSRT) Update(img gocv.Mat) (image.Rectangle, bool)

Update updates this Tracker.

type TrackerKCF Uses

type TrackerKCF struct {
    // contains filtered or unexported fields
}

TrackerKCF is a Tracker based on KCF, which is a novel tracking framework that utilizes properties of circulant matrix to enhance the processing speed.

For further details, please see: https://docs.opencv.org/master/d2/dff/classcv_1_1TrackerKCF.html

func (TrackerKCF) Close Uses

func (trk TrackerKCF) Close() error

Close closes this Tracker.

func (TrackerKCF) Init Uses

func (trk TrackerKCF) Init(img gocv.Mat, boundingBox image.Rectangle) bool

Init initializes this Tracker.

func (TrackerKCF) Update Uses

func (trk TrackerKCF) Update(img gocv.Mat) (image.Rectangle, bool)

Update updates this Tracker.

type TrackerMIL Uses

type TrackerMIL struct {
    // contains filtered or unexported fields
}

TrackerMIL is a Tracker that uses the MIL algorithm. MIL trains a classifier in an online manner to separate the object from the background. Multiple Instance Learning avoids the drift problem for a robust tracking.

For further details, please see: https://docs.opencv.org/master/d0/d26/classcv_1_1TrackerMIL.html

func (TrackerMIL) Close Uses

func (trk TrackerMIL) Close() error

Close closes the TrackerMIL.

func (TrackerMIL) Init Uses

func (trk TrackerMIL) Init(img gocv.Mat, boundingBox image.Rectangle) bool

Init initializes the TrackerMIL.

func (TrackerMIL) Update Uses

func (trk TrackerMIL) Update(img gocv.Mat) (image.Rectangle, bool)

Update updates the TrackerMIL.

type TrackerMOSSE Uses

type TrackerMOSSE struct {
    // contains filtered or unexported fields
}

TrackerMOSSE uses Visual Object Tracking using Adaptive Correlation Filters. Note, that this tracker only works on graysccale images.

For further details, please see: https://docs.opencv.org/master/d0/d02/classcv_1_1TrackerMOSSE.html

func (TrackerMOSSE) Close Uses

func (trk TrackerMOSSE) Close() error

Close closes this Tracker.

func (TrackerMOSSE) Init Uses

func (trk TrackerMOSSE) Init(img gocv.Mat, boundingBox image.Rectangle) bool

Init initializes this Tracker.

func (TrackerMOSSE) Update Uses

func (trk TrackerMOSSE) Update(img gocv.Mat) (image.Rectangle, bool)

Update updates this Tracker.

type TrackerMedianFlow Uses

type TrackerMedianFlow struct {
    // contains filtered or unexported fields
}

TrackerMedianFlow is a Tracker implementation suitable for very smooth and predictable movements when the object is visible throughout the whole sequence.

For further details, please see: https://docs.opencv.org/master/d7/d86/classcv_1_1TrackerMedianFlow.html

func (TrackerMedianFlow) Close Uses

func (trk TrackerMedianFlow) Close() error

Close closes the Tracker.

func (TrackerMedianFlow) Init Uses

func (trk TrackerMedianFlow) Init(img gocv.Mat, boundingBox image.Rectangle) bool

Init initializes the Tracker.

func (TrackerMedianFlow) Update Uses

func (trk TrackerMedianFlow) Update(img gocv.Mat) (image.Rectangle, bool)

Update updates the Tracker.

type TrackerTLD Uses

type TrackerTLD struct {
    // contains filtered or unexported fields
}

TrackerTLD is a novel tracking framework that explicitly decomposes the long-term tracking task into tracking, learning and detection.

For further details, please see: https://docs.opencv.org/master/dc/d1c/classcv_1_1TrackerTLD.html

func (TrackerTLD) Close Uses

func (trk TrackerTLD) Close() error

Close closes this Tracker.

func (TrackerTLD) Init Uses

func (trk TrackerTLD) Init(img gocv.Mat, boundingBox image.Rectangle) bool

Init initializes this Tracker.

func (TrackerTLD) Update Uses

func (trk TrackerTLD) Update(img gocv.Mat) (image.Rectangle, bool)

Update updates this Tracker.

Package contrib imports 5 packages (graph) and is imported by 2 packages. Updated 2019-05-27. Refresh now. Tools for package owners.