コード例 #1
0
 /// <summary>
 /// Draw keypoint matches from two images on the output image.
 /// </summary>
 /// <param name="image1">The first image.</param>
 /// <param name="keyPoints1">The collection of keypoints from the first image.</param>
 /// <param name="image2">The second image.</param>
 /// <param name="keyPoints2">The collection of keypoints from the second image.</param>
 /// <param name="matches">The matches from the first image to the second image.</param>
 /// <param name="outImage">The image where the keypoint matches are to be drawn.</param>
 public static void DrawMatches(
     Arr image1, KeyPointCollection keyPoints1,
     Arr image2, KeyPointCollection keyPoints2,
     DMatchCollection matches, Arr outImage)
 {
     DrawMatches(image1, keyPoints1, image2, keyPoints2, matches, outImage, Scalar.All(-1));
 }
コード例 #2
0
        /// <summary>
        /// Finds the best match for each descriptor in <paramref name="queryDescriptors"/>.
        /// </summary>
        /// <param name="matcher">The descriptor matcher used to find correspondences between descriptor sets.</param>
        /// <param name="queryDescriptors">The set of descriptors for which to find the best match.</param>
        /// <param name="trainDescriptors">The training set of descriptors.</param>
        /// <param name="mask">
        /// The optional operation mask specifying permissible matches between input query descriptors
        /// and stored training descriptors.
        /// </param>
        /// <returns>
        /// The collection of best matches found for each permissible descriptor in
        /// <paramref name="queryDescriptors"/>.
        /// </returns>
        public static DMatchCollection Match(this IDescriptorMatcher matcher, Arr queryDescriptors, Arr trainDescriptors, Arr mask = null)
        {
            if (matcher == null)
            {
                throw new ArgumentNullException("matcher");
            }

            var matches = new DMatchCollection();

            matcher.Match(queryDescriptors, trainDescriptors, matches, mask);
            return(matches);
        }
コード例 #3
0
 /// <summary>
 /// Draw keypoint matches from two images on the output image.
 /// </summary>
 /// <param name="image1">The first image.</param>
 /// <param name="keyPoints1">The collection of keypoints from the first image.</param>
 /// <param name="image2">The second image.</param>
 /// <param name="keyPoints2">The collection of keypoints from the second image.</param>
 /// <param name="matches">The matches from the first image to the second image.</param>
 /// <param name="outImage">The image where the keypoint matches are to be drawn.</param>
 /// <param name="matchColor">The color used for drawing successful matches.</param>
 /// <param name="singlePointColor">The color used for drawing unmatched keypoints.</param>
 /// <param name="matchesMask">The optional mask specifying which matches are drawn.</param>
 /// <param name="flags">Optional operation flags specifying how the matches are to be drawn.</param>
 public static void DrawMatches(
     Arr image1, KeyPointCollection keyPoints1,
     Arr image2, KeyPointCollection keyPoints2,
     DMatchCollection matches, Arr outImage,
     Scalar matchColor,
     Scalar singlePointColor,
     ByteCollection matchesMask = null,
     DrawMatchesFlags flags     = DrawMatchesFlags.None)
 {
     NativeMethods.cv_features2d_drawMatches(
         image1, keyPoints1,
         image2, keyPoints2,
         matches, outImage,
         matchColor, singlePointColor,
         matchesMask ?? ByteCollection.Null, flags);
 }
コード例 #4
0
 /// <summary>
 /// Finds the best match for each descriptor in <paramref name="queryDescriptors"/>.
 /// </summary>
 /// <param name="queryDescriptors">The set of descriptors for which to find the best match.</param>
 /// <param name="trainDescriptors">The training set of descriptors.</param>
 /// <param name="matches">
 /// The collection of best matches found for each permissible descriptor in
 /// <paramref name="queryDescriptors"/>.
 /// </param>
 /// <param name="mask">
 /// The optional operation mask specifying permissible matches between input query descriptors
 /// and stored training descriptors.
 /// </param>
 public abstract void Match(Arr queryDescriptors, Arr trainDescriptors, DMatchCollection matches, Arr mask = null);
コード例 #5
0
 /// <summary>
 /// Finds the best match for each descriptor in <paramref name="queryDescriptors"/>.
 /// </summary>
 /// <param name="queryDescriptors">The set of descriptors for which to find the best match.</param>
 /// <param name="trainDescriptors">The training set of descriptors.</param>
 /// <param name="matches">
 /// The collection of best matches found for each permissible descriptor in
 /// <paramref name="queryDescriptors"/>.
 /// </param>
 /// <param name="mask">
 /// The optional operation mask specifying permissible matches between input query descriptors
 /// and stored training descriptors.
 /// </param>
 public override void Match(Arr queryDescriptors, Arr trainDescriptors, DMatchCollection matches, Arr mask)
 {
     NativeMethods.cv_features2d_BFMatcher_match(this, queryDescriptors, trainDescriptors, matches, mask ?? Arr.Null);
 }