Class LightGlueMatcher
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
LightGlue: a deep learning based descriptor matcher with an attention mechanism (OpenCV 5). Runs an ONNX model through the DNN module. Requires OpenCV built with the dnn module.
public class LightGlueMatcher : DescriptorMatcher, IDisposable
- Inheritance
-
LightGlueMatcher
- Implements
- Inherited Members
Methods
ClearPairInfo()
Clears stored pair context information.
public void ClearPairInfo()
Create(string, float, int, int)
Creates a LightGlueMatcher from a model file path.
public static LightGlueMatcher Create(string modelPath, float scoreThreshold = 0, int backend = 0, int target = 0)
Parameters
modelPathstringPath to the ONNX model file.
scoreThresholdfloatMatch confidence threshold.
backendintDNN backend (see Backend). Default is 0 (DEFAULT).
targetintDNN target (see Target). Default is 0 (CPU).
Returns
CreateFromMemory(byte[], float, int, int)
Creates a LightGlueMatcher from an in-memory ONNX model buffer.
public static LightGlueMatcher CreateFromMemory(byte[] modelData, float scoreThreshold = 0, int backend = 0, int target = 0)
Parameters
modelDatabyte[]Buffer containing the model data.
scoreThresholdfloatMatch confidence threshold.
backendintDNN backend (see Backend). Default is 0 (DEFAULT).
targetintDNN target (see Target). Default is 0 (CPU).
Returns
SetPairInfo(InputArray, InputArray, Size, Size)
Sets the keypoint and image size context for the next match() call. Must be called before match()/knnMatch()/radiusMatch() unless using automatic context from in-process ALIKED instances.
public void SetPairInfo(InputArray queryKpts, InputArray trainKpts, Size queryImageSize = default, Size trainImageSize = default)
Parameters
queryKptsInputArrayQuery image keypoints (Nx2 float matrix with x,y coordinates).
trainKptsInputArrayTrain image keypoints (Nx2 float matrix with x,y coordinates).
queryImageSizeSizeSize of the query image (width, height).
trainImageSizeSizeSize of the train image (width, height).