キーポイントとマッチの描画関数 ============================================= .. highlight:: cpp .. index:: drawMatches cv::drawMatches --------------- `id=0.522799189078 Comments from the Wiki `__ .. cfunction:: void drawMatches( const Mat\& img1, const vector\& keypoints1, const Mat\& img2, const vector\& keypoints2, const vector\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector\& matchesMask=vector(), int flags=DrawMatchesFlags::DEFAULT ) この関数は,2つの画像から得られるキーポイント同士のマッチを,出力画像上に描画します. マッチは,2つのキーポイント(円)を結ぶ線分で表現されます. .. cfunction:: void drawMatches( const Mat\& img1, const vector\& keypoints1, const Mat\& img2, const vector\& keypoints2, const vector >\& matches1to2, Mat\& outImg, const Scalar\& matchColor=Scalar::all(-1), const Scalar\& singlePointColor=Scalar::all(-1), const vector>\& matchesMask= vector >(), int flags=DrawMatchesFlags::DEFAULT ) :param img1: 1番目の入力画像. :param keypoints1: 1番目の入力画像から得られたキーポイント. :param img2: 2番目の入力画像. :param keypoints2: 2番目の入力画像から得られたキーポイント. :param matches: 1番目と2番目の画像間のマッチ. つまり, ``keypoints1[i]`` は,点 ``keypoints2[matches[i]]`` に対応します. :param outImg: 出力画像.出力画像に何が描画されるかは, ``flags`` の値に依存します. 後述の,取り得る ``flags`` のビット値を参照してください. :param matchColor: マッチの色(線分と,それで接続されるキーポイント). ``matchColor==Scalar::all(-1)`` の場合,ランダムに色が生成されます. :param singlePointColor: シングルキーポイント,つまり,マッチを持たないキーポイントの色(円). ``singlePointColor==Scalar::all(-1)`` の場合,ランダムに色が生成されます. :param matchesMask: どのマッチが描画されるかを指定するマスク.これが空の場合は,すべてのマッチが描画されます. :param flags: ``flags`` の各ビットは,描画のプロパティを設定します. 取り得る ``flags`` ビット値は, ``DrawMatchesFlags`` で定義されます.以下を参照してください. .. code-block:: c struct DrawMatchesFlags { enum{ DEFAULT = 0, // 出力画像行列が作成 (Mat::create) されます. // つまり,出力画像の元のメモリ領域が新たに再利用される可能性があります. // 2 つの入力画像,マッチ,シングルキーポイントが描画されます. // 各キーポイントに対しては,中心点のみが描画されます // (キーポイントのサイズと方向を表す周囲の円は描画されません). DRAW_OVER_OUTIMG = 1, // 出力画像行列が作成 (Mat::create) されません. // 既存の出力画像上に,マッチが描画されます. NOT_DRAW_SINGLE_POINTS = 2, // シングルキーポイントは描画されません. DRAW_RICH_KEYPOINTS = 4 // 各キーポイントに対して,そのサイズと方向を表す // 周囲の円が描画されます. }; }; .. .. index:: drawKeypoints cv::drawKeypoints ----------------- `id=0.168114855594 Comments from the Wiki `__ .. cfunction:: void drawKeypoints( const Mat\& image, const vector\& keypoints, Mat\& outImg, const Scalar\& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT ) キーポイントを描画します. :param image: 入力画像. :param keypoints: 入力画像から得られたキーポイント. :param outImg: 出力画像.出力画像に何が描画されるかは, ``flags`` の値に依存します. 取り得る ``flags`` のビット値を参照してください. :param color: キーポイントの色. :param flags: ``flags`` の各ビットは,描画のプロパティを設定します. 取り得る ``flags`` ビット値は, ``DrawMatchesFlags`` で定義されます. 上述の :func:`drawMatches` の項を参照してください.