Match key pointsđź”—
A superclass for tools that match objects based on key point coordinates and their associated feature descriptors.
This tool maintains a database of object models as feature points and quickly retrieves matching models for unknown objects. Each feature point is described by point coordinates and a feature vector (a.k.a â€śdescriptorâ€ť). The point coordinates specify the location of the feature point with respect to the model. The tool can handle two and threedimensional point coordinates.
There can be an unlimited number of models, each containing an unlimited number of feature points. Furthermore, each model may have an associated class index. This makes it possible to have multiple models for a class of objects.
This tool implements a fast key point database search algorithm but does not specify a geometric model for the arrangement of the matched key points. Different geometric models are needed in different applications, and these are implemented by inherited tools such as rigid 2D matching.
Inputsđź”—
keyPoints
: The locations of key points in world coordinates. A NbyX matrix in which each row contains Xdimensional point coordinates (usually 2, but may be 3). Each point must have a corresponding feature vector in features. Otherwise, a runtime error will be generated.features
: A feature vector for each point. An NbyD matrix in which each row stores a feature point descriptor (Ddimensional vector).modelPoints
: The locations of model key points in world coordinates. A PbyX matrix.modelFeatures
: A feature vector for each model key point. A PbyD matrix.modelIndices
: The index of the model the key points belong to. A Pby1 matrix.modelFrames
: An optional parameter specifying a coordinate frame for each model, in world coordinates. A 4Mby4 matrix. If a match for a model is found, this coordinate frame will be transformed based on its location and reported as the *frame* of the match. If model frames are not provided, the tool automatically places the frame to the upper left corner of the axisaligned bounding box of the modelâ€™s key points. IfmodelFrames* is nonempty, modelSizes must be provided as well.modelSizes
: An optional parameter specifying the size of each model in world coordinates. A Mby2 matrix. If model sizes are not provided, the tool automatically uses the size of the axisaligned bounding box of the modelâ€™s key points. If modelSizes is nonempty, modelFrames must also be provided. Note that the frame and size of a model may specify any area in world coordinates; the key points donâ€™t need to be enclosed by it.modelClasses
: Class indices for each model. If this matrix is nonempty, there must be a class index for each of the M models, resulting in a Mby1 matrix. If this matrix is empty, the class and model indices will be the same.classNames
: A Cby1 table that contains the names of the classes. The modelClasses parameter may not contain values that are greater than C  1.maxMatches
: The maximum allowed number of matches. Setting maxMatches to one returns the best match only. Zero disables this limit.closestMatchCount
: The number of closest matches against which each query point will be compared. By default, only the closest match in the model database will be considered. A greater value means higher accuracy and lower speed.maxEvaluations
: The maximum number of evaluations when searching the database for matching feature vectors. Setting maxEvaluations to zero makes the search algorithm perform an exact search: for each feature vector, the closest match(es) will be found with a probability of one. Limiting the number of evaluations may be useful if the model database is large. The limit turns the exact search into an approximate one that returns the probably closest neighbors if it runs out of time. Choosing maxEvaluations appropriately makes it possible to return correct matches for the majority of feature points while making the search much faster.
Outputsđź”—
frame
: The location of the matched object in world coordinates. The matcher first finds the transformation between points and the matching model. The modelâ€™s frame is then transformed according to it. This output parameter contains the transformed frame(s). A 4*Nby4 matrix.size
: The size of the matched object in world coordinates. An Nby2 matrix.modelIndex
: The index of the model that matched. An Nby1 matrix.classIndex
: The class index of the matching model. An Nby1 matrix.className
: The class name of the matching model. An Nby1 table.confidence
: Confidence of the match (0â€¦1). The bigger the value, the better the match. An Nby1 matrix.

enum
MatchingMode
đź”— Strategies for selecting matching models.
Values:

enumerator
ManyMatchesPerModel
đź”— The input image is searched for any number of matches of any of the database objects.
As a result, zero or more matches may be found, and the same model may be found multiple times. This mode is suitable if objects may overlap and many similar objects may be present.

enumerator
OneMatchPerModel
đź”— The input image is searched for any number of objects, but at most one match is allowed for each model.
This mode is suitable if only the existence of an object matters.

enumerator