DISK
import { DISK } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Feature2D.
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).
Constructors and members
static create
Creates a DISK detector.
create(modelPath: EmbindString, maxKeypoints: number, scoreThreshold: number, imageSize: Size, backendId: number, targetId: number): DISK | null;6 available overloads
create(modelPath: EmbindString): DISK | null;create(modelPath: EmbindString, maxKeypoints: number): DISK | null;create(modelPath: EmbindString, maxKeypoints: number, scoreThreshold: number): DISK | null;create(modelPath: EmbindString, maxKeypoints: number, scoreThreshold: number, imageSize: Size): DISK | null;create(modelPath: EmbindString, maxKeypoints: number, scoreThreshold: number, imageSize: Size, backendId: number): DISK | null;create(modelPath: EmbindString, maxKeypoints: number, scoreThreshold: number, imageSize: Size, backendId: number, targetId: number): DISK | null;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.
The DISK | null result.
static createFromMemory
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.
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.
createFromMemory(bufferModel: ucharVector, maxKeypoints: number, scoreThreshold: number, imageSize: Size, backendId: number, targetId: number): DISK | null;6 available overloads
createFromMemory(bufferModel: ucharVector): DISK | null;createFromMemory(bufferModel: ucharVector, maxKeypoints: number): DISK | null;createFromMemory(bufferModel: ucharVector, maxKeypoints: number, scoreThreshold: number): DISK | null;createFromMemory(bufferModel: ucharVector, maxKeypoints: number, scoreThreshold: number, imageSize: Size): DISK | null;createFromMemory(bufferModel: ucharVector, maxKeypoints: number, scoreThreshold: number, imageSize: Size, backendId: number): DISK | null;createFromMemory(bufferModel: ucharVector, maxKeypoints: number, scoreThreshold: number, imageSize: Size, backendId: number, targetId: number): DISK | null;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.
The DISK | null result.
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
setMaxKeypoints
Set the max keypoints used by this DISK object.
setMaxKeypoints(maxKeypoints: number): void;maxKeypointsmax keypoints argument (number).
getMaxKeypoints
Return the max keypoints configured on this DISK object.
getMaxKeypoints(): number;The number result.
setScoreThreshold
Set the score threshold used by this DISK object.
setScoreThreshold(threshold: number): void;thresholdthreshold argument (number).
getScoreThreshold
Return the score threshold configured on this DISK object.
getScoreThreshold(): number;The number result.
setImageSize
Set the image size used by this DISK object.
setImageSize(size: Size): void;sizesize argument (Size).
getImageSize
Return the image size configured on this DISK object.
getImageSize(): Size;The Size result.
getDefaultName
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.
getDefaultName(): string;The string result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.