OpenCV for Unity 3.0.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/5.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.FeaturesModule.LightGlueMatcher Class Reference

LightGlue feature matcher. More...

Public Member Functions

void clearPairInfo ()
 Clears stored pair context information.
 
void setPairInfo (Mat queryKpts, Mat trainKpts)
 Sets the keypoint and image size context for the next match() call.
 
void setPairInfo (Mat queryKpts, Mat trainKpts, in Vec2d queryImageSize)
 Sets the keypoint and image size context for the next match() call.
 
void setPairInfo (Mat queryKpts, Mat trainKpts, in Vec2d queryImageSize, in Vec2d trainImageSize)
 Sets the keypoint and image size context for the next match() call.
 
void setPairInfo (Mat queryKpts, Mat trainKpts, in(double width, double height) queryImageSize)
 Sets the keypoint and image size context for the next match() call.
 
void setPairInfo (Mat queryKpts, Mat trainKpts, in(double width, double height) queryImageSize, in(double width, double height) trainImageSize)
 Sets the keypoint and image size context for the next match() call.
 
void setPairInfo (Mat queryKpts, Mat trainKpts, Size queryImageSize)
 Sets the keypoint and image size context for the next match() call.
 
void setPairInfo (Mat queryKpts, Mat trainKpts, Size queryImageSize, Size trainImageSize)
 Sets the keypoint and image size context for the next match() call.
 
- Public Member Functions inherited from OpenCVForUnity.FeaturesModule.DescriptorMatcher
void add (List< Mat > descriptors)
 Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor collection.
 
override void clear ()
 Clears the train descriptor collections.
 
DescriptorMatcher clone ()
 Clones the matcher.
 
DescriptorMatcher clone (bool emptyTrainData)
 Clones the matcher.
 
override bool empty ()
 Returns true if there are no train descriptors in the both collections.
 
List< Mat > getTrainDescriptors ()
 Returns a constant link to the train descriptor collection trainDescCollection .
 
bool isMaskSupported ()
 Returns true if the descriptor matcher supports masking permissible matches.
 
void knnMatch (Mat queryDescriptors, List< MatOfDMatch > matches, int k)
 
void knnMatch (Mat queryDescriptors, List< MatOfDMatch > matches, int k, List< Mat > masks)
 
void knnMatch (Mat queryDescriptors, List< MatOfDMatch > matches, int k, List< Mat > masks, bool compactResult)
 
void knnMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, int k)
 Finds the k best matches for each descriptor from a query set.
 
void knnMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, int k, Mat mask)
 Finds the k best matches for each descriptor from a query set.
 
void knnMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, int k, Mat mask, bool compactResult)
 Finds the k best matches for each descriptor from a query set.
 
void match (Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches)
 Finds the best match for each descriptor from a query set.
 
void match (Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches, Mat mask)
 Finds the best match for each descriptor from a query set.
 
void match (Mat queryDescriptors, MatOfDMatch matches)
 
void match (Mat queryDescriptors, MatOfDMatch matches, List< Mat > masks)
 
void radiusMatch (Mat queryDescriptors, List< MatOfDMatch > matches, float maxDistance)
 
void radiusMatch (Mat queryDescriptors, List< MatOfDMatch > matches, float maxDistance, List< Mat > masks)
 
void radiusMatch (Mat queryDescriptors, List< MatOfDMatch > matches, float maxDistance, List< Mat > masks, bool compactResult)
 
void radiusMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, float maxDistance)
 For each query descriptor, finds the training descriptors not farther than the specified distance.
 
void radiusMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, float maxDistance, Mat mask)
 For each query descriptor, finds the training descriptors not farther than the specified distance.
 
void radiusMatch (Mat queryDescriptors, Mat trainDescriptors, List< MatOfDMatch > matches, float maxDistance, Mat mask, bool compactResult)
 For each query descriptor, finds the training descriptors not farther than the specified distance.
 
void read (string fileName)
 
void train ()
 Trains a descriptor matcher.
 
void write (string fileName)
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
virtual string getDefaultName ()
 
IntPtr getNativeObjAddr ()
 
void save (string filename)
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 Releases resources used by this object.
 
void ThrowIfDisposed ()
 Throws ObjectDisposedException if this object has been disposed.
 

Static Public Member Functions

static new LightGlueMatcher __fromPtr__ (IntPtr addr)
 
static new LightGlueMatcher create (string modelPath)
 Creates LightGlueMatcher from a model file path.
 
static LightGlueMatcher create (string modelPath, float scoreThreshold)
 Creates LightGlueMatcher from a model file path.
 
static LightGlueMatcher create (string modelPath, float scoreThreshold, int backend)
 Creates LightGlueMatcher from a model file path.
 
static LightGlueMatcher create (string modelPath, float scoreThreshold, int backend, int target)
 Creates LightGlueMatcher from a model file path.
 
static LightGlueMatcher createFromMemory (MatOfByte modelData)
 Creates LightGlueMatcher from in-memory model data.
 
static LightGlueMatcher createFromMemory (MatOfByte modelData, float scoreThreshold)
 Creates LightGlueMatcher from in-memory model data.
 
static LightGlueMatcher createFromMemory (MatOfByte modelData, float scoreThreshold, int backend)
 Creates LightGlueMatcher from in-memory model data.
 
static LightGlueMatcher createFromMemory (MatOfByte modelData, float scoreThreshold, int backend, int target)
 Creates LightGlueMatcher from in-memory model data.
 
- Static Public Member Functions inherited from OpenCVForUnity.FeaturesModule.DescriptorMatcher
static new DescriptorMatcher __fromPtr__ (IntPtr addr)
 
static DescriptorMatcher create (int matcherType)
 
static DescriptorMatcher create (string descriptorMatcherType)
 Creates a descriptor matcher of a given type with the default parameters (using default constructor).
 
- Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
static Algorithm __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 Returns the native pointer, or throws CoreModule.CvException if it is zero.
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.FeaturesModule.DescriptorMatcher
- Protected Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 Initializes a new instance with a zero native pointer and dispose enabled.
 
 DisposableOpenCVObject (bool isEnabledDispose)
 Initializes a new instance with a zero native pointer.
 
 DisposableOpenCVObject (IntPtr ptr)
 Initializes a new instance with the specified native pointer and dispose enabled.
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 Initializes a new instance with the specified native pointer.
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 Initializes a new instance with dispose enabled.
 
 DisposableObject (bool isEnabledDispose)
 Initializes a new instance.
 

Additional Inherited Members

- Static Public Attributes inherited from OpenCVForUnity.FeaturesModule.DescriptorMatcher
const int BRUTEFORCE = 2
 C++: enum MatcherType (cv.DescriptorMatcher.MatcherType)
 
const int BRUTEFORCE_HAMMING = 4
 C++: enum MatcherType (cv.DescriptorMatcher.MatcherType)
 
const int BRUTEFORCE_HAMMINGLUT = 5
 C++: enum MatcherType (cv.DescriptorMatcher.MatcherType)
 
const int BRUTEFORCE_L1 = 3
 C++: enum MatcherType (cv.DescriptorMatcher.MatcherType)
 
const int BRUTEFORCE_SL2 = 6
 C++: enum MatcherType (cv.DescriptorMatcher.MatcherType)
 
const int FLANNBASED = 1
 C++: enum MatcherType (cv.DescriptorMatcher.MatcherType)
 
- Package Functions inherited from OpenCVForUnity.FeaturesModule.DescriptorMatcher
- Package Functions inherited from OpenCVForUnity.CoreModule.Algorithm
- Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

LightGlue feature matcher.

LightGlue is a CNN-based feature matcher, as described in [Lindenberger23] . It takes keypoint locations and descriptors from two images and directly predicts match pairs. Unlike traditional matchers that compute descriptor distances, LightGlue uses attention mechanisms to produce confidence scores for each potential match pair.

The matcher extends DescriptorMatcher and supports the standard match(), knnMatch(), and radiusMatch() interfaces. Context (keypoints and image sizes) must be provided via setPairInfo() before matching.

Member Function Documentation

◆ __fromPtr__()

static new LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.__fromPtr__ ( IntPtr addr)
static

◆ clearPairInfo()

void OpenCVForUnity.FeaturesModule.LightGlueMatcher.clearPairInfo ( )

Clears stored pair context information.

◆ create() [1/4]

static new LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.create ( string modelPath)
static

Creates LightGlueMatcher from a model file path.

Parameters
modelPathPath to the ONNX model file.
scoreThresholdMatch confidence threshold.
backendDNN backend
targetDNN target

◆ create() [2/4]

static LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.create ( string modelPath,
float scoreThreshold )
static

Creates LightGlueMatcher from a model file path.

Parameters
modelPathPath to the ONNX model file.
scoreThresholdMatch confidence threshold.
backendDNN backend
targetDNN target

◆ create() [3/4]

static LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.create ( string modelPath,
float scoreThreshold,
int backend )
static

Creates LightGlueMatcher from a model file path.

Parameters
modelPathPath to the ONNX model file.
scoreThresholdMatch confidence threshold.
backendDNN backend
targetDNN target

◆ create() [4/4]

static LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.create ( string modelPath,
float scoreThreshold,
int backend,
int target )
static

Creates LightGlueMatcher from a model file path.

Parameters
modelPathPath to the ONNX model file.
scoreThresholdMatch confidence threshold.
backendDNN backend
targetDNN target

◆ createFromMemory() [1/4]

static LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.createFromMemory ( MatOfByte modelData)
static

Creates LightGlueMatcher from in-memory model data.

Parameters
modelDataBuffer containing the model data.
scoreThresholdMatch confidence threshold.
backendDNN backend
targetDNN target

◆ createFromMemory() [2/4]

static LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.createFromMemory ( MatOfByte modelData,
float scoreThreshold )
static

Creates LightGlueMatcher from in-memory model data.

Parameters
modelDataBuffer containing the model data.
scoreThresholdMatch confidence threshold.
backendDNN backend
targetDNN target

◆ createFromMemory() [3/4]

static LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.createFromMemory ( MatOfByte modelData,
float scoreThreshold,
int backend )
static

Creates LightGlueMatcher from in-memory model data.

Parameters
modelDataBuffer containing the model data.
scoreThresholdMatch confidence threshold.
backendDNN backend
targetDNN target

◆ createFromMemory() [4/4]

static LightGlueMatcher OpenCVForUnity.FeaturesModule.LightGlueMatcher.createFromMemory ( MatOfByte modelData,
float scoreThreshold,
int backend,
int target )
static

Creates LightGlueMatcher from in-memory model data.

Parameters
modelDataBuffer containing the model data.
scoreThresholdMatch confidence threshold.
backendDNN backend
targetDNN target

◆ Dispose()

override void OpenCVForUnity.FeaturesModule.LightGlueMatcher.Dispose ( bool disposing)
protectedvirtual

◆ setPairInfo() [1/7]

void OpenCVForUnity.FeaturesModule.LightGlueMatcher.setPairInfo ( Mat queryKpts,
Mat trainKpts )

Sets the keypoint and image size context for the next match() call.

This provides the spatial context that LightGlue needs in addition to descriptors. Must be called before match()/knnMatch()/radiusMatch() unless using automatic context from in-process ALIKED instances.

Parameters
queryKptsQuery image keypoints (Nx2 float matrix with x,y coordinates).
trainKptsTrain image keypoints (Nx2 float matrix with x,y coordinates).
queryImageSizeSize of the query image (width, height).
trainImageSizeSize of the train image (width, height).

◆ setPairInfo() [2/7]

void OpenCVForUnity.FeaturesModule.LightGlueMatcher.setPairInfo ( Mat queryKpts,
Mat trainKpts,
in Vec2d queryImageSize )

Sets the keypoint and image size context for the next match() call.

This provides the spatial context that LightGlue needs in addition to descriptors. Must be called before match()/knnMatch()/radiusMatch() unless using automatic context from in-process ALIKED instances.

Parameters
queryKptsQuery image keypoints (Nx2 float matrix with x,y coordinates).
trainKptsTrain image keypoints (Nx2 float matrix with x,y coordinates).
queryImageSizeSize of the query image (width, height).
trainImageSizeSize of the train image (width, height).

◆ setPairInfo() [3/7]

void OpenCVForUnity.FeaturesModule.LightGlueMatcher.setPairInfo ( Mat queryKpts,
Mat trainKpts,
in Vec2d queryImageSize,
in Vec2d trainImageSize )

Sets the keypoint and image size context for the next match() call.

This provides the spatial context that LightGlue needs in addition to descriptors. Must be called before match()/knnMatch()/radiusMatch() unless using automatic context from in-process ALIKED instances.

Parameters
queryKptsQuery image keypoints (Nx2 float matrix with x,y coordinates).
trainKptsTrain image keypoints (Nx2 float matrix with x,y coordinates).
queryImageSizeSize of the query image (width, height).
trainImageSizeSize of the train image (width, height).

◆ setPairInfo() [4/7]

void OpenCVForUnity.FeaturesModule.LightGlueMatcher.setPairInfo ( Mat queryKpts,
Mat trainKpts,
in(double width, double height) queryImageSize )

Sets the keypoint and image size context for the next match() call.

This provides the spatial context that LightGlue needs in addition to descriptors. Must be called before match()/knnMatch()/radiusMatch() unless using automatic context from in-process ALIKED instances.

Parameters
queryKptsQuery image keypoints (Nx2 float matrix with x,y coordinates).
trainKptsTrain image keypoints (Nx2 float matrix with x,y coordinates).
queryImageSizeSize of the query image (width, height).
trainImageSizeSize of the train image (width, height).

◆ setPairInfo() [5/7]

void OpenCVForUnity.FeaturesModule.LightGlueMatcher.setPairInfo ( Mat queryKpts,
Mat trainKpts,
in(double width, double height) queryImageSize,
in(double width, double height) trainImageSize )

Sets the keypoint and image size context for the next match() call.

This provides the spatial context that LightGlue needs in addition to descriptors. Must be called before match()/knnMatch()/radiusMatch() unless using automatic context from in-process ALIKED instances.

Parameters
queryKptsQuery image keypoints (Nx2 float matrix with x,y coordinates).
trainKptsTrain image keypoints (Nx2 float matrix with x,y coordinates).
queryImageSizeSize of the query image (width, height).
trainImageSizeSize of the train image (width, height).

◆ setPairInfo() [6/7]

void OpenCVForUnity.FeaturesModule.LightGlueMatcher.setPairInfo ( Mat queryKpts,
Mat trainKpts,
Size queryImageSize )

Sets the keypoint and image size context for the next match() call.

This provides the spatial context that LightGlue needs in addition to descriptors. Must be called before match()/knnMatch()/radiusMatch() unless using automatic context from in-process ALIKED instances.

Parameters
queryKptsQuery image keypoints (Nx2 float matrix with x,y coordinates).
trainKptsTrain image keypoints (Nx2 float matrix with x,y coordinates).
queryImageSizeSize of the query image (width, height).
trainImageSizeSize of the train image (width, height).

◆ setPairInfo() [7/7]

void OpenCVForUnity.FeaturesModule.LightGlueMatcher.setPairInfo ( Mat queryKpts,
Mat trainKpts,
Size queryImageSize,
Size trainImageSize )

Sets the keypoint and image size context for the next match() call.

This provides the spatial context that LightGlue needs in addition to descriptors. Must be called before match()/knnMatch()/radiusMatch() unless using automatic context from in-process ALIKED instances.

Parameters
queryKptsQuery image keypoints (Nx2 float matrix with x,y coordinates).
trainKptsTrain image keypoints (Nx2 float matrix with x,y coordinates).
queryImageSizeSize of the query image (width, height).
trainImageSizeSize of the train image (width, height).

The documentation for this class was generated from the following files: