OpenCV for Unity 3.0.5
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.XFeat Class Reference

XFeat feature detector and descriptor, based on a DNN model. More...

Public Member Functions

override string getDefaultName ()
 
Size getInputSize ()
 
double double height getInputSizeAsValueTuple ()
 
Vec2d getInputSizeAsVec2d ()
 
int getMaxKeypoints ()
 
float getScoreThreshold ()
 
void setInputSize (in Vec2d inputSize)
 
void setInputSize (in(double width, double height) inputSize)
 
void setInputSize (Size inputSize)
 
void setMaxKeypoints (int maxKeypoints)
 
void setScoreThreshold (float threshold)
 
- Public Member Functions inherited from OpenCVForUnity.FeaturesModule.Feature2D
void compute (List< Mat > images, List< MatOfKeyPoint > keypoints, List< Mat > descriptors)
 
void compute (Mat image, MatOfKeyPoint keypoints, Mat descriptors)
 Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).
 
int defaultNorm ()
 
int descriptorSize ()
 
int descriptorType ()
 
void detect (List< Mat > images, List< MatOfKeyPoint > keypoints)
 
void detect (List< Mat > images, List< MatOfKeyPoint > keypoints, List< Mat > masks)
 
void detect (Mat image, MatOfKeyPoint keypoints)
 Detects keypoints in an image (first variant) or image set (second variant).
 
void detect (Mat image, MatOfKeyPoint keypoints, Mat mask)
 Detects keypoints in an image (first variant) or image set (second variant).
 
void detectAndCompute (Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors)
 
void detectAndCompute (Mat image, Mat mask, MatOfKeyPoint keypoints, Mat descriptors, bool useProvidedKeypoints)
 
override bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.
 
void read (string fileName)
 
void write (string fileName)
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
virtual void clear ()
 Clears the algorithm state.
 
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 XFeat __fromPtr__ (IntPtr addr)
 
static XFeat create (string modelPath)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, in Vec2d inputSize)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, in Vec2d inputSize, int backendId)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, in Vec2d inputSize, int backendId, int targetId)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, in(double width, double height) inputSize)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, in(double width, double height) inputSize, int backendId)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, in(double width, double height) inputSize, int backendId, int targetId)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, Size inputSize)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, Size inputSize, int backendId)
 Creates an XFeat detector.
 
static XFeat create (string modelPath, int maxKeypoints, float scoreThreshold, Size inputSize, int backendId, int targetId)
 Creates an XFeat detector.
 
static XFeat createFromMemory (MatOfByte bufferModel)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, in Vec2d inputSize)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, in Vec2d inputSize, int backendId)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, in Vec2d inputSize, int backendId, int targetId)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, in(double width, double height) inputSize)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, in(double width, double height) inputSize, int backendId)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, in(double width, double height) inputSize, int backendId, int targetId)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, Size inputSize)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, Size inputSize, int backendId)
 Creates an XFeat detector from an in-memory model buffer.
 
static XFeat createFromMemory (MatOfByte bufferModel, int maxKeypoints, float scoreThreshold, Size inputSize, int backendId, int targetId)
 Creates an XFeat detector from an in-memory model buffer.
 
- Static Public Member Functions inherited from OpenCVForUnity.FeaturesModule.Feature2D
static new Feature2D __fromPtr__ (IntPtr addr)
 
- 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.
 

Public Attributes

double width
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.FeaturesModule.Feature2D
- 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

- Package Functions inherited from OpenCVForUnity.FeaturesModule.Feature2D
- 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

XFeat feature detector and descriptor, based on a DNN model.

XFeat is a compact learned local-feature extractor. This class wraps an ONNX export through cv::dnn::Net and exposes score-map detections with 64-D float descriptors under the standard cv::Feature2D interface.

The class assumes the ONNX model has a single grayscale input tensor N×1×H×W in [0, 1] and returns descriptor and score maps. The descriptor map must have 64 channels, and the keypoint logit map must have either 64 channels (no extra class) or 65 channels, where the last channel is treated as a dustbin/background class used only in softmax normalization. Images are resized with preserved aspect ratio and padded to the configured network input size.

Member Function Documentation

◆ __fromPtr__()

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

◆ create() [1/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath)
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [2/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [3/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [4/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
in Vec2d inputSize )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [5/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
in Vec2d inputSize,
int backendId )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [6/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
in Vec2d inputSize,
int backendId,
int targetId )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [7/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
in(double width, double height) inputSize )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [8/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
in(double width, double height) inputSize,
int backendId )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [9/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
in(double width, double height) inputSize,
int backendId,
int targetId )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [10/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
Size inputSize )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [11/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
Size inputSize,
int backendId )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ create() [12/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.create ( string modelPath,
int maxKeypoints,
float scoreThreshold,
Size inputSize,
int backendId,
int targetId )
static

Creates an XFeat detector.

Parameters
modelPathPath to the XFeat ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score not greater than this value.
inputSizeInput size fed to the network, default Size(640, 640).
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ createFromMemory() [1/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel)
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [2/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [3/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [4/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
in Vec2d inputSize )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [5/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
in Vec2d inputSize,
int backendId )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [6/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
in Vec2d inputSize,
int backendId,
int targetId )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [7/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
in(double width, double height) inputSize )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [8/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
in(double width, double height) inputSize,
int backendId )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [9/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
in(double width, double height) inputSize,
int backendId,
int targetId )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [10/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
Size inputSize )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [11/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
Size inputSize,
int backendId )
static

Creates an XFeat detector from an in-memory model buffer.

◆ createFromMemory() [12/12]

static XFeat OpenCVForUnity.FeaturesModule.XFeat.createFromMemory ( MatOfByte bufferModel,
int maxKeypoints,
float scoreThreshold,
Size inputSize,
int backendId,
int targetId )
static

Creates an XFeat detector from an in-memory model buffer.

◆ Dispose()

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

◆ getDefaultName()

override string OpenCVForUnity.FeaturesModule.XFeat.getDefaultName ( )
virtual

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.

Reimplemented from OpenCVForUnity.FeaturesModule.Feature2D.

◆ getInputSize()

Size OpenCVForUnity.FeaturesModule.XFeat.getInputSize ( )

◆ getInputSizeAsValueTuple()

double double height OpenCVForUnity.FeaturesModule.XFeat.getInputSizeAsValueTuple ( )

◆ getInputSizeAsVec2d()

Vec2d OpenCVForUnity.FeaturesModule.XFeat.getInputSizeAsVec2d ( )

◆ getMaxKeypoints()

int OpenCVForUnity.FeaturesModule.XFeat.getMaxKeypoints ( )

◆ getScoreThreshold()

float OpenCVForUnity.FeaturesModule.XFeat.getScoreThreshold ( )

◆ setInputSize() [1/3]

void OpenCVForUnity.FeaturesModule.XFeat.setInputSize ( in Vec2d inputSize)

◆ setInputSize() [2/3]

void OpenCVForUnity.FeaturesModule.XFeat.setInputSize ( in(double width, double height) inputSize)

◆ setInputSize() [3/3]

void OpenCVForUnity.FeaturesModule.XFeat.setInputSize ( Size inputSize)

◆ setMaxKeypoints()

void OpenCVForUnity.FeaturesModule.XFeat.setMaxKeypoints ( int maxKeypoints)

◆ setScoreThreshold()

void OpenCVForUnity.FeaturesModule.XFeat.setScoreThreshold ( float threshold)

Member Data Documentation

◆ width

double OpenCVForUnity.FeaturesModule.XFeat.width

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