This example shows how to use the prebuilt MATLAB interface for the OpenCV functioncv::Fastin MATLAB to detect keypoints in an image. Additionally, use thekeyPointsToStructutility function to write the keypoints returned by the OpenCVcv::Fastfunction to a MATLAB structure.
Add the MATLAB interface to OpenCV package names to the import list.
importclib.opencv.*; importvision.opencv.util.*;
Read an image into the MATLAB workspace.
img = imread("elephant.jpg");
Create MATLAB interface objects for the OpenCVMatNDandInputArrayclasses to store the input image.
[inputMat,inputArray] = createMat(img);
Create a MATLAB interface object for the OpenCVKeyPointvector by using theclibArrayfunction.
OpenCVKeyPointsclass, specified as a MATLAB interface object. This interface object is a representation of theKeyPointsclass returned by any of the OpenCV functions for keypoint detection.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.