OpenCV 2.4.11

org.opencv.features2d

Class GenericDescriptorMatcher

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int FERN 
      static int ONEWAY 
    • Method Detail

      • add

        public void add(java.util.List<Mat> images,
               java.util.List<MatOfKeyPoint> keypoints)

        Adds images and their keypoints to the training collection stored in the class instance.

        Parameters:
        images - Image collection.
        keypoints - Point collection. It is assumed that keypoints[i] are keypoints detected in the image images[i].
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.add
      • classify

        public void classify(Mat queryImage,
                    MatOfKeyPoint queryKeypoints)

        Classifies keypoints from a query set.

        The method classifies each keypoint from a query set. The first variant of the method takes a train image and its keypoints as an input argument. The second variant uses the internally stored training collection that can be built using the GenericDescriptorMatcher.add method.

        The methods do the following:

        • Call the GenericDescriptorMatcher.match method to find correspondence between the query set and the training set.
        • Set the class_id field of each keypoint from the query set to class_id of the corresponding keypoint from the training set.
        Parameters:
        queryImage - Query image.
        queryKeypoints - Keypoints from a query image.
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.classify
      • classify

        public void classify(Mat queryImage,
                    MatOfKeyPoint queryKeypoints,
                    Mat trainImage,
                    MatOfKeyPoint trainKeypoints)

        Classifies keypoints from a query set.

        The method classifies each keypoint from a query set. The first variant of the method takes a train image and its keypoints as an input argument. The second variant uses the internally stored training collection that can be built using the GenericDescriptorMatcher.add method.

        The methods do the following:

        • Call the GenericDescriptorMatcher.match method to find correspondence between the query set and the training set.
        • Set the class_id field of each keypoint from the query set to class_id of the corresponding keypoint from the training set.
        Parameters:
        queryImage - Query image.
        queryKeypoints - Keypoints from a query image.
        trainImage - Train image.
        trainKeypoints - Keypoints from a train image.
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.classify
      • empty

        public boolean empty()
      • knnMatch

        public void knnMatch(Mat queryImage,
                    MatOfKeyPoint queryKeypoints,
                    java.util.List<MatOfDMatch> matches,
                    int k)

        Finds the k best matches for each query keypoint.

        The methods are extended variants of GenericDescriptorMatch.match. The parameters are similar, and the semantics is similar to DescriptorMatcher.knnMatch. But this class does not require explicitly computed keypoint descriptors.

        Parameters:
        queryImage - a queryImage
        queryKeypoints - a queryKeypoints
        matches - a matches
        k - a k
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.knnMatch
      • knnMatch

        public void knnMatch(Mat queryImage,
                    MatOfKeyPoint queryKeypoints,
                    java.util.List<MatOfDMatch> matches,
                    int k,
                    java.util.List<Mat> masks,
                    boolean compactResult)

        Finds the k best matches for each query keypoint.

        The methods are extended variants of GenericDescriptorMatch.match. The parameters are similar, and the semantics is similar to DescriptorMatcher.knnMatch. But this class does not require explicitly computed keypoint descriptors.

        Parameters:
        queryImage - a queryImage
        queryKeypoints - a queryKeypoints
        matches - a matches
        k - a k
        masks - a masks
        compactResult - a compactResult
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.knnMatch
      • knnMatch

        public void knnMatch(Mat queryImage,
                    MatOfKeyPoint queryKeypoints,
                    Mat trainImage,
                    MatOfKeyPoint trainKeypoints,
                    java.util.List<MatOfDMatch> matches,
                    int k)

        Finds the k best matches for each query keypoint.

        The methods are extended variants of GenericDescriptorMatch.match. The parameters are similar, and the semantics is similar to DescriptorMatcher.knnMatch. But this class does not require explicitly computed keypoint descriptors.

        Parameters:
        queryImage - a queryImage
        queryKeypoints - a queryKeypoints
        trainImage - a trainImage
        trainKeypoints - a trainKeypoints
        matches - a matches
        k - a k
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.knnMatch
      • knnMatch

        public void knnMatch(Mat queryImage,
                    MatOfKeyPoint queryKeypoints,
                    Mat trainImage,
                    MatOfKeyPoint trainKeypoints,
                    java.util.List<MatOfDMatch> matches,
                    int k,
                    Mat mask,
                    boolean compactResult)

        Finds the k best matches for each query keypoint.

        The methods are extended variants of GenericDescriptorMatch.match. The parameters are similar, and the semantics is similar to DescriptorMatcher.knnMatch. But this class does not require explicitly computed keypoint descriptors.

        Parameters:
        queryImage - a queryImage
        queryKeypoints - a queryKeypoints
        trainImage - a trainImage
        trainKeypoints - a trainKeypoints
        matches - a matches
        k - a k
        mask - a mask
        compactResult - a compactResult
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.knnMatch
      • match

        public void match(Mat queryImage,
                 MatOfKeyPoint queryKeypoints,
                 Mat trainImage,
                 MatOfKeyPoint trainKeypoints,
                 MatOfDMatch matches)

        Finds the best match in the training set for each keypoint from the query set.

        The methods find the best match for each query keypoint. In the first variant of the method, a train image and its keypoints are the input arguments. In the second variant, query keypoints are matched to the internally stored training collection that can be built using the GenericDescriptorMatcher.add method. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryKeypoints[i] can be matched with trainKeypoints[j] only if mask.at(i,j) is non-zero.

        Parameters:
        queryImage - Query image.
        queryKeypoints - Keypoints detected in queryImage.
        trainImage - Train image. It is not added to a train image collection stored in the class object.
        trainKeypoints - Keypoints detected in trainImage. They are not added to a train points collection stored in the class object.
        matches - Matches. If a query descriptor (keypoint) is masked out in mask, match is added for this descriptor. So, matches size may be smaller than the query keypoints count.
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.match
      • match

        public void match(Mat queryImage,
                 MatOfKeyPoint queryKeypoints,
                 Mat trainImage,
                 MatOfKeyPoint trainKeypoints,
                 MatOfDMatch matches,
                 Mat mask)

        Finds the best match in the training set for each keypoint from the query set.

        The methods find the best match for each query keypoint. In the first variant of the method, a train image and its keypoints are the input arguments. In the second variant, query keypoints are matched to the internally stored training collection that can be built using the GenericDescriptorMatcher.add method. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryKeypoints[i] can be matched with trainKeypoints[j] only if mask.at(i,j) is non-zero.

        Parameters:
        queryImage - Query image.
        queryKeypoints - Keypoints detected in queryImage.
        trainImage - Train image. It is not added to a train image collection stored in the class object.
        trainKeypoints - Keypoints detected in trainImage. They are not added to a train points collection stored in the class object.
        matches - Matches. If a query descriptor (keypoint) is masked out in mask, match is added for this descriptor. So, matches size may be smaller than the query keypoints count.
        mask - Mask specifying permissible matches between an input query and train keypoints.
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.match
      • match

        public void match(Mat queryImage,
                 MatOfKeyPoint queryKeypoints,
                 MatOfDMatch matches)

        Finds the best match in the training set for each keypoint from the query set.

        The methods find the best match for each query keypoint. In the first variant of the method, a train image and its keypoints are the input arguments. In the second variant, query keypoints are matched to the internally stored training collection that can be built using the GenericDescriptorMatcher.add method. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryKeypoints[i] can be matched with trainKeypoints[j] only if mask.at(i,j) is non-zero.

        Parameters:
        queryImage - Query image.
        queryKeypoints - Keypoints detected in queryImage.
        matches - Matches. If a query descriptor (keypoint) is masked out in mask, match is added for this descriptor. So, matches size may be smaller than the query keypoints count.
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.match
      • match

        public void match(Mat queryImage,
                 MatOfKeyPoint queryKeypoints,
                 MatOfDMatch matches,
                 java.util.List<Mat> masks)

        Finds the best match in the training set for each keypoint from the query set.

        The methods find the best match for each query keypoint. In the first variant of the method, a train image and its keypoints are the input arguments. In the second variant, query keypoints are matched to the internally stored training collection that can be built using the GenericDescriptorMatcher.add method. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryKeypoints[i] can be matched with trainKeypoints[j] only if mask.at(i,j) is non-zero.

        Parameters:
        queryImage - Query image.
        queryKeypoints - Keypoints detected in queryImage.
        matches - Matches. If a query descriptor (keypoint) is masked out in mask, match is added for this descriptor. So, matches size may be smaller than the query keypoints count.
        masks - Set of masks. Each masks[i] specifies permissible matches between input query keypoints and stored train keypoints from the i-th image.
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.match
      • radiusMatch

        public void radiusMatch(Mat queryImage,
                       MatOfKeyPoint queryKeypoints,
                       java.util.List<MatOfDMatch> matches,
                       float maxDistance)

        For each query keypoint, finds the training keypoints not farther than the specified distance.

        The methods are similar to DescriptorMatcher.radius. But this class does not require explicitly computed keypoint descriptors.

        Parameters:
        queryImage - a queryImage
        queryKeypoints - a queryKeypoints
        matches - a matches
        maxDistance - a maxDistance
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.radiusMatch
      • radiusMatch

        public void radiusMatch(Mat queryImage,
                       MatOfKeyPoint queryKeypoints,
                       java.util.List<MatOfDMatch> matches,
                       float maxDistance,
                       java.util.List<Mat> masks,
                       boolean compactResult)

        For each query keypoint, finds the training keypoints not farther than the specified distance.

        The methods are similar to DescriptorMatcher.radius. But this class does not require explicitly computed keypoint descriptors.

        Parameters:
        queryImage - a queryImage
        queryKeypoints - a queryKeypoints
        matches - a matches
        maxDistance - a maxDistance
        masks - a masks
        compactResult - a compactResult
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.radiusMatch
      • radiusMatch

        public void radiusMatch(Mat queryImage,
                       MatOfKeyPoint queryKeypoints,
                       Mat trainImage,
                       MatOfKeyPoint trainKeypoints,
                       java.util.List<MatOfDMatch> matches,
                       float maxDistance)

        For each query keypoint, finds the training keypoints not farther than the specified distance.

        The methods are similar to DescriptorMatcher.radius. But this class does not require explicitly computed keypoint descriptors.

        Parameters:
        queryImage - a queryImage
        queryKeypoints - a queryKeypoints
        trainImage - a trainImage
        trainKeypoints - a trainKeypoints
        matches - a matches
        maxDistance - a maxDistance
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.radiusMatch
      • radiusMatch

        public void radiusMatch(Mat queryImage,
                       MatOfKeyPoint queryKeypoints,
                       Mat trainImage,
                       MatOfKeyPoint trainKeypoints,
                       java.util.List<MatOfDMatch> matches,
                       float maxDistance,
                       Mat mask,
                       boolean compactResult)

        For each query keypoint, finds the training keypoints not farther than the specified distance.

        The methods are similar to DescriptorMatcher.radius. But this class does not require explicitly computed keypoint descriptors.

        Parameters:
        queryImage - a queryImage
        queryKeypoints - a queryKeypoints
        trainImage - a trainImage
        trainKeypoints - a trainKeypoints
        matches - a matches
        maxDistance - a maxDistance
        mask - a mask
        compactResult - a compactResult
        See Also:
        org.opencv.features2d.GenericDescriptorMatcher.radiusMatch