select
Description
selects one or more sets of point or region features using the specified indices
indexedPoints
= select(points
,ind
)ind
.
Examples
Select Point Features During Code Generation
Read an image into the MATLAB® workspace.
I = imread("cameraman.tif");
Define the helperGetSubsetOfPoints
function, which detects and selects SURF points. You must save the helper function as a MATLAB script file with a .m
extension.
function indexedLocation = helperGetSubsetOfPoints(I) points = detectSURFFeatures(I); indexedPoints = select(points,30:100); indexedLocation = indexedPoints.Location; end
Create a configuration object for generating a MEX function.
cfg = coder.config("mex");
Generate the MEX function from the helper function helperGetSubsetOfPoints
using the configuration cfg
. The helperGetSubsetOfPoints
function detects SURF features in the input image and selects a specified set of point features using the select
object function of the SURFPoints
object. The helperGetSubsetOfPoints
function outputs the locations of the selected SURF point features in the image. You can use the select
function only for code generation.
codegen -config cfg helperGetSubsetOfPoints -args {I}
Code generation successful.
Call the generated MEX function with the image I
as input. Because code generation cannot return objects as outputs, the helperGetSubsetOfPoints
function outputs the locations of the selected SURF point features.
locations = helperGetSubsetOfPoints_mex(I);
Convert the output locations to SURFPoints
objects.
points = SURFPoints(locations);
Display the selected SURF point features.
figure
imshow(I)
hold on
plot(points)
hold off
Input Arguments
points
— Input features
MSERRegions
object | SURFPoints
object | ORBPoints
object | KAZEPoints
object | BRISKPoints
object | SIFTPoints
object | cornerPoints
object
Input features, specified as an MSERRegions
, SURFPoints
, ORBPoints
,
KAZEPoints
,
BRISKPoints
, SIFTPoints
,
or cornerPoints
object.
ind
— Indices of features to be selected
scalar | vector
Indices of the features to be selected from the input, specified as a scalar or vector.
Output Arguments
indexedPoints
— Output features
MSERRegions
object | SURFPoints
object | ORBPoints
object | KAZEPoints
object | BRISKPoints
object | SIFTPoints
object | cornerPoints
object
Output features, returned as an MSERRegions
, SURFPoints
, ORBPoints
,
KAZEPoints
,
BRISKPoints
, SIFTPoints
,
or cornerPoints
object. The
indexedPoints
output object type matches the type of object
specified to the points
input argument.
Version History
Introduced in R2024b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
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.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)