Exemple #1
0
 internal static extern void cvCalcArrBackProjectPatch(
     IntPtr[] image,
     Arr dst,
     Size range,
     Histogram hist,
     HistogramComparison method,
     double factor);
Exemple #2
0
        /// <summary>
        /// 2つの密なヒストグラムを比較する (cvCompareHist相当).
        /// 疎なヒストグラム,あるいは重み付けされた点が集まったような,より一般的な構造を比較するためには,関数cvCalcEMD2 を用いる方が良い場合もある.
        /// </summary>
        /// <param name="hist">比較対象の密なヒストグラム</param>
        /// <param name="method">比較手法</param>
#else
        /// <summary>
        /// Compares two dense histograms.
        /// </summary>
        /// <param name="hist">target histogram</param>
        /// <param name="method">Comparison method.</param>
        /// <returns></returns>
#endif
        public double Compare(CvHistogram hist, HistogramComparison method)
        {
            if (hist == null)
            {
                throw new ArgumentNullException("hist");
            }
            return(NativeMethods.cvCompareHist(ptr, hist.CvPtr, method));
        }
Exemple #3
0
        /// <summary>
        /// Locates a template within an image by using a histogram comparison.
        /// </summary>
        /// <param name="images">Source images.</param>
        /// <param name="dst">Destination image.</param>
        /// <param name="range">Size of the patch slid though the source image.</param>
        /// <param name="method">The histogram comparison method.</param>
        /// <param name="factor">Normalization factor for histograms.</param>
        public void CalcArrBackProjectPatch(
            Arr[] images,
            Arr dst,
            Size range,
            HistogramComparison method,
            double factor)
        {
            var pImages = Array.ConvertAll(images, image => image.DangerousGetHandle());

            NativeMethods.cvCalcArrBackProjectPatch(pImages, dst, range, this, method, factor);
            GC.KeepAlive(images);
        }
Exemple #4
0
 public static extern double cvCompareHist(IntPtr hist1, IntPtr hist2, HistogramComparison method);
 /// <summary>
 /// compares two histograms stored in dense arrays
 /// </summary>
 /// <param name="h1">The first compared histogram</param>
 /// <param name="h2">The second compared histogram of the same size as h1</param>
 /// <param name="method">The comparison method</param>
 /// <returns></returns>
 public static double CompareHist(InputArray h1, InputArray h2, HistogramComparison method)
 {
     if (h1 == null)
         throw new ArgumentNullException("h1");
     if (h2 == null)
         throw new ArgumentNullException("h2");
     h1.ThrowIfDisposed();
     h2.ThrowIfDisposed();
     return NativeMethods.imgproc_compareHist1(h1.CvPtr, h2.CvPtr, (int)method);
 }
        /// <summary>
        /// 2つの密なヒストグラムを比較する (cvCompareHist相当).
        /// 疎なヒストグラム,あるいは重み付けされた点が集まったような,より一般的な構造を比較するためには,関数cvCalcEMD2 を用いる方が良い場合もある.
        /// </summary>
        /// <param name="hist">比較対象の密なヒストグラム</param>
        /// <param name="method">比較手法</param>
#else
        /// <summary>
        /// Compares two dense histograms.
        /// </summary>
        /// <param name="hist">target histogram</param>
        /// <param name="method">Comparison method.</param>
        /// <returns></returns>
#endif
        public double Compare(CvHistogram hist, HistogramComparison method)
        {
            if (hist == null)
            {
                throw new ArgumentNullException("hist");
            }
            return CvInvoke.cvCompareHist(_ptr, hist.CvPtr, method);
        }
        /// <summary>
        /// ヒストグラムの比較に基づき画像内部でのテンプレート位置を求める
        /// </summary>
        /// <param name="image">入力画像群( CvMat** 形式でも構わない).すべて同じサイズ.</param>
        /// <param name="dst">出力画像</param>
        /// <param name="patch_size">入力画像群上をスライドさせるテンプレートのサイズ</param>
        /// <param name="method">比較方法.値は関数 cvCompareHist に渡される(この関数に関する記述を参照)</param>
        /// <param name="factor">ヒストグラムの正規化係数.出力画像の正規化スケールに影響する.値に確信がない場合は,1にする.</param>
        /// <returns></returns>
#else
        /// <summary>
        /// Locates a template within image by histogram comparison
        /// </summary>
        /// <param name="image">Source images (though you may pass CvMat** as well), all are of the same size and type </param>
        /// <param name="dst">Destination image. </param>
        /// <param name="patch_size">Size of patch slid though the source images. </param>
        /// <param name="method">Compasion method, passed to cvCompareHist (see description of that function). </param>
        /// <param name="factor">Normalization factor for histograms, will affect normalization scale of destination image, pass 1. if unsure. </param>
        /// <returns></returns>
#endif
        public void CalcBackProjectPatch(CvArr[] image, CvArr dst, CvSize patch_size, HistogramComparison method, float factor)
        {
            Cv.CalcArrBackProjectPatch(image, dst, patch_size, this, method, factor);
        }
Exemple #8
0
        /// <summary>
        /// ヒストグラムの比較に基づき画像内部でのテンプレート位置を求める
        /// </summary>
        /// <param name="image">入力画像群( CvMat** 形式でも構わない).すべて同じサイズ.</param>
        /// <param name="dst">出力画像</param>
        /// <param name="patchSize">入力画像群上をスライドさせるテンプレートのサイズ</param>
        /// <param name="method">比較方法.値は関数 cvCompareHist に渡される(この関数に関する記述を参照)</param>
        /// <param name="factor">ヒストグラムの正規化係数.出力画像の正規化スケールに影響する.値に確信がない場合は,1にする.</param>
        /// <returns></returns>
#else
        /// <summary>
        /// Locates a template within image by histogram comparison
        /// </summary>
        /// <param name="image">Source images (though you may pass CvMat** as well), all are of the same size and type </param>
        /// <param name="dst">Destination image. </param>
        /// <param name="patchSize">Size of patch slid though the source images. </param>
        /// <param name="method">Compasion method, passed to cvCompareHist (see description of that function). </param>
        /// <param name="factor">Normalization factor for histograms, will affect normalization scale of destination image, pass 1. if unsure. </param>
        /// <returns></returns>
#endif
        public void CalcBackProjectPatch(CvArr[] image, CvArr dst, CvSize patchSize, HistogramComparison method, float factor)
        {
            Cv.CalcArrBackProjectPatch(image, dst, patchSize, this, method, factor);
        }
Exemple #9
0
 /// <summary>
 /// Compares this histogram with another dense histogram.
 /// </summary>
 /// <param name="other">The second dense histogram.</param>
 /// <param name="method">The comparison method to be used.</param>
 /// <returns>The distance between the two histograms.</returns>
 public double Compare(Histogram other, HistogramComparison method)
 {
     return(NativeMethods.cvCompareHist(this, other, method));
 }
Exemple #10
0
        /// <summary>
        /// ヒストグラムの比較に基づき画像内部でのテンプレート位置を求める
        /// </summary>
        /// <param name="image">入力画像群( CvMat** 形式でも構わない).すべて同じサイズ.</param>
        /// <param name="dst">出力画像</param>
        /// <param name="patchSize">入力画像群上をスライドさせるテンプレートのサイズ</param>
        /// <param name="method">比較方法.値は関数 cvCompareHist に渡される(この関数に関する記述を参照)</param>
        /// <returns></returns>
#else
        /// <summary>
        /// Locates a template within image by histogram comparison
        /// </summary>
        /// <param name="image">Source images (though you may pass CvMat** as well), all are of the same size and type </param>
        /// <param name="dst">Destination image. </param>
        /// <param name="patchSize">Size of patch slid though the source images. </param>
        /// <param name="method">Compasion method, passed to cvCompareHist (see description of that function). </param>
        /// <returns></returns>
#endif
        public void CalcArrBackProjectPatch(CvArr[] image, CvArr dst, CvSize patchSize, HistogramComparison method)
        {
            Cv.CalcArrBackProjectPatch(image, dst, patchSize, this, method);
        }
Exemple #11
0
 internal static extern double cvCompareHist(Histogram hist1, Histogram hist2, HistogramComparison method);