OpenCV 5.0.0
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::DISK Class Referenceabstract

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

#include <opencv2/features.hpp>

Public Member Functions

virtual String getDefaultName () const CV_OVERRIDE
virtual Size getImageSize () const =0
virtual int getMaxKeypoints () const =0
virtual float getScoreThreshold () const =0
virtual void setImageSize (const Size &size)=0
virtual void setMaxKeypoints (int maxKeypoints)=0
virtual void setScoreThreshold (float threshold)=0
Public Member Functions inherited from cv::Feature2D
virtual ~Feature2D ()
virtual void compute (InputArray image, std::vector< KeyPoint > &keypoints, OutputArray descriptors)
 Computes the descriptors for a set of keypoints detected in an image (first variant) or image set (second variant).
virtual void compute (InputArrayOfArrays images, std::vector< std::vector< KeyPoint > > &keypoints, OutputArrayOfArrays descriptors)
virtual int defaultNorm () const
virtual int descriptorSize () const
virtual int descriptorType () const
virtual void detect (InputArray image, std::vector< KeyPoint > &keypoints, InputArray mask=noArray())
 Detects keypoints in an image (first variant) or image set (second variant).
virtual void detect (InputArrayOfArrays images, std::vector< std::vector< KeyPoint > > &keypoints, InputArrayOfArrays masks=noArray())
virtual void detectAndCompute (InputArray image, InputArray mask, std::vector< KeyPoint > &keypoints, OutputArray descriptors, bool useProvidedKeypoints=false)
virtual bool empty () const CV_OVERRIDE
 Return true if detector object is empty.
virtual void read (const FileNode &) CV_OVERRIDE
 Reads algorithm parameters from a file storage.
void read (const String &fileName)
void write (const String &fileName) const
virtual void write (FileStorage &) const CV_OVERRIDE
 Stores algorithm parameters in a file storage.
void write (FileStorage &fs, const String &name) const
Public Member Functions inherited from cv::Algorithm
 Algorithm ()
virtual ~Algorithm ()
virtual void clear ()
 Clears the algorithm state.
virtual void save (const String &filename) const
void write (FileStorage &fs, const String &name) const

Static Public Member Functions

static Ptr< DISKcreate (const std::vector< uchar > &bufferModel, int maxKeypoints=-1, float scoreThreshold=0.0f, const Size &imageSize=Size(), int backendId=0, int targetId=0)
 Creates a DISK detector from an in-memory model buffer.
static Ptr< DISKcreate (const String &modelPath, int maxKeypoints=-1, float scoreThreshold=0.0f, const Size &imageSize=Size(), int backendId=0, int targetId=0)
 Creates a DISK detector.
Static Public Member Functions inherited from cv::Algorithm
template<typename _Tp>
static Ptr< _Tpload (const String &filename, const String &objname=String())
 Loads algorithm from the file.
template<typename _Tp>
static Ptr< _TploadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String.
template<typename _Tp>
static Ptr< _Tpread (const FileNode &fn)
 Reads algorithm from the file node.

Additional Inherited Members

Protected Member Functions inherited from cv::Algorithm
void writeFormat (FileStorage &fs) const

Detailed Description

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

DISK (Deep Image Structure and Keypoints) is a learned local-feature pipeline that produces keypoints and 128-D L2-normalized descriptors via a single forward pass through a fully convolutional network. This class wraps an ONNX export of the pre-trained DISK model through cv::dnn::Net and exposes it under the standard cv::Feature2D interface so it can be used as a drop-in alternative to SIFT/ORB.

The class assumes the ONNX model has a single input named image taking an N×3×H×W float32 tensor in [0, 1] (RGB channel order) and three outputs named keypoints (N×2), scores (N) and descriptors (N×128).

Member Function Documentation

◆ create() [1/2]

Ptr< DISK > cv::DISK::create ( const std::vector< uchar > & bufferModel,
int maxKeypoints = -1,
float scoreThreshold = 0.0f,
const Size & imageSize = Size(),
int backendId = 0,
int targetId = 0 )
static
Python:
cv.DISK.create(modelPath[, maxKeypoints[, scoreThreshold[, imageSize[, backendId[, targetId]]]]]) -> retval
cv.DISK.createFromMemory(bufferModel[, maxKeypoints[, scoreThreshold[, imageSize[, backendId[, targetId]]]]]) -> retval
cv.DISK_create(modelPath[, maxKeypoints[, scoreThreshold[, imageSize[, backendId[, targetId]]]]]) -> retval
cv.DISK_createFromMemory(bufferModel[, maxKeypoints[, scoreThreshold[, imageSize[, backendId[, targetId]]]]]) -> retval

Creates a DISK detector from an in-memory model buffer.

This overload loads the DISK ONNX model from a buffer instead of a file on disk. It is intended for cases where the model is read from application resources (for example Android assets) and is not available as a path on the filesystem.

Parameters
bufferModelA buffer containing the contents of the DISK ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses (by network score) are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score strictly below this value.
imageSizeTarget input size (width, height) fed to the network. Use Size() (the default) to fall back to the network's expected fixed input shape of 1024x1024. When overriding, both dimensions must be positive multiples of 16, since DISK downsamples by a factor of 16.
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.
Note
In C++ this is an overload of create. The Python/Java/Objective-C bindings expose it as createFromMemory, because Objective-C selectors are not disambiguated by argument type and would otherwise clash with the file-path create.

◆ create() [2/2]

Ptr< DISK > cv::DISK::create ( const String & modelPath,
int maxKeypoints = -1,
float scoreThreshold = 0.0f,
const Size & imageSize = Size(),
int backendId = 0,
int targetId = 0 )
static
Python:
cv.DISK.create(modelPath[, maxKeypoints[, scoreThreshold[, imageSize[, backendId[, targetId]]]]]) -> retval
cv.DISK.createFromMemory(bufferModel[, maxKeypoints[, scoreThreshold[, imageSize[, backendId[, targetId]]]]]) -> retval
cv.DISK_create(modelPath[, maxKeypoints[, scoreThreshold[, imageSize[, backendId[, targetId]]]]]) -> retval
cv.DISK_createFromMemory(bufferModel[, maxKeypoints[, scoreThreshold[, imageSize[, backendId[, targetId]]]]]) -> retval

Creates a DISK detector.

Parameters
modelPathPath to the DISK ONNX model.
maxKeypointsMaximum number of keypoints to return per image. The strongest responses (by network score) are kept; -1 keeps all detections.
scoreThresholdDiscard keypoints with network score strictly below this value.
imageSizeTarget input size (width, height) fed to the network. Use Size() (the default) to fall back to the network's expected fixed input shape of 1024x1024. When overriding, both dimensions must be positive multiples of 16, since DISK downsamples by a factor of 16.
backendIdDNN backend identifier (see cv::dnn::Backend); 0 = DNN_BACKEND_DEFAULT.
targetIdDNN target identifier (see cv::dnn::Target); 0 = DNN_TARGET_CPU.

◆ getDefaultName()

virtual String cv::DISK::getDefaultName ( ) const
virtual
Python:
cv.DISK.getDefaultName() -> retval

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 cv::Feature2D.

◆ getImageSize()

virtual Size cv::DISK::getImageSize ( ) const
pure virtual
Python:
cv.DISK.getImageSize() -> retval

◆ getMaxKeypoints()

virtual int cv::DISK::getMaxKeypoints ( ) const
pure virtual
Python:
cv.DISK.getMaxKeypoints() -> retval

◆ getScoreThreshold()

virtual float cv::DISK::getScoreThreshold ( ) const
pure virtual
Python:
cv.DISK.getScoreThreshold() -> retval

◆ setImageSize()

virtual void cv::DISK::setImageSize ( const Size & size)
pure virtual
Python:
cv.DISK.setImageSize(size) -> None

◆ setMaxKeypoints()

virtual void cv::DISK::setMaxKeypoints ( int maxKeypoints)
pure virtual
Python:
cv.DISK.setMaxKeypoints(maxKeypoints) -> None

◆ setScoreThreshold()

virtual void cv::DISK::setScoreThreshold ( float threshold)
pure virtual
Python:
cv.DISK.setScoreThreshold(threshold) -> None

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