| 1307 | | CvDll.cvCalcBackProject(image_ptr, back_project.CvPtr, hist.CvPtr); |
| 1308 | | } |
| 1309 | | #endregion |
| 1310 | | #region CalcBackProjectPatch |
| | 1307 | CvDll.cvCalcArrBackProject(image_ptr, back_project.CvPtr, hist.CvPtr); |
| | 1308 | } |
| | 1309 | #if LANG_JP |
| | 1310 | /// <summary> |
| | 1311 | /// バックプロジェクションの計算を行う |
| | 1312 | /// </summary> |
| | 1313 | /// <param name="image">入力画像群</param> |
| | 1314 | /// <param name="back_project">出力のバックプロジェクション画像.入力画像群と同じタイプ.</param> |
| | 1315 | /// <param name="hist">ヒストグラム</param> |
| | 1316 | /// <returns></returns> |
| | 1317 | #else |
| | 1318 | /// <summary> |
| | 1319 | /// Calculates back projection |
| | 1320 | /// </summary> |
| | 1321 | /// <param name="image">Source images (though you may pass CvMat** as well), all are of the same size and type </param> |
| | 1322 | /// <param name="back_project">Destination back projection image of the same type as the source images. </param> |
| | 1323 | /// <param name="hist">Histogram. </param> |
| | 1324 | /// <returns></returns> |
| | 1325 | #endif |
| | 1326 | public static void CalcBackProject(CvArr[] image, CvArr back_project, CvHistogram hist) |
| | 1327 | { |
| | 1328 | CalcArrBackProject(image, back_project, hist); |
| | 1329 | } |
| | 1330 | #endregion |
| | 1331 | #region CalcArrBackProjectPatch |
| 1332 | | public static void CalcBackProjectPatch(CvArr[] image, CvArr dst, CvSize patch_size, CvHistogram hist, HistogramComparison method) |
| 1333 | | { |
| 1334 | | if (image == null) |
| 1335 | | { |
| 1336 | | throw new ArgumentNullException("image"); |
| 1337 | | } |
| 1338 | | if (dst == null) |
| 1339 | | { |
| 1340 | | throw new ArgumentNullException("dst"); |
| 1341 | | } |
| 1342 | | if (hist == null) |
| 1343 | | { |
| 1344 | | throw new ArgumentNullException("hist"); |
| 1345 | | } |
| 1346 | | IntPtr[] image_ptr = new IntPtr[image.Length]; |
| 1347 | | for (int i = 0; i < image.Length; i++) |
| 1348 | | { |
| 1349 | | image_ptr[i] = image[i].CvPtr; |
| 1350 | | } |
| 1351 | | CvDll.cvCalcBackProjectPatch(image_ptr, dst.CvPtr, patch_size, hist.CvPtr, (int)method, 1f); |
| | 1353 | public static void CalcArrBackProjectPatch(CvArr[] image, CvArr dst, CvSize patch_size, CvHistogram hist, HistogramComparison method) |
| | 1354 | { |
| | 1355 | CalcArrBackProjectPatch(image, dst, patch_size, hist, method, 1f); |
| 1395 | | CvDll.cvCalcBackProjectPatch(image_ptr, dst.CvPtr, patch_size, hist.CvPtr, (int)method, factor); |
| | 1399 | CvDll.cvCalcArrBackProjectPatch(image_ptr, dst.CvPtr, patch_size, hist.CvPtr, (int)method, factor); |
| | 1400 | } |
| | 1401 | #if LANG_JP |
| | 1402 | /// <summary> |
| | 1403 | /// ヒストグラムの比較に基づき画像内部でのテンプレート位置を求める |
| | 1404 | /// </summary> |
| | 1405 | /// <param name="image">入力画像群( CvMat** 形式でも構わない).すべて同じサイズ.</param> |
| | 1406 | /// <param name="dst">出力画像</param> |
| | 1407 | /// <param name="patch_size">入力画像群上をスライドさせるテンプレートのサイズ</param> |
| | 1408 | /// <param name="hist">テンプレートのヒストグラム</param> |
| | 1409 | /// <param name="method">比較方法.値は関数 cvCompareHist に渡される(この関数に関する記述を参照)</param> |
| | 1410 | /// <returns></returns> |
| | 1411 | #else |
| | 1412 | /// <summary> |
| | 1413 | /// Locates a template within image by histogram comparison |
| | 1414 | /// </summary> |
| | 1415 | /// <param name="image">Source images (though you may pass CvMat** as well), all are of the same size and type </param> |
| | 1416 | /// <param name="dst">Destination image. </param> |
| | 1417 | /// <param name="patch_size">Size of patch slid though the source images. </param> |
| | 1418 | /// <param name="hist">Histogram. </param> |
| | 1419 | /// <param name="method">Compasion method, passed to cvCompareHist (see description of that function). </param> |
| | 1420 | /// <returns></returns> |
| | 1421 | #endif |
| | 1422 | public static void CalcBackProjectPatch(CvArr[] image, CvArr dst, CvSize patch_size, CvHistogram hist, HistogramComparison method) |
| | 1423 | { |
| | 1424 | CalcArrBackProjectPatch(image, dst, patch_size, hist, method, 1f); |
| | 1425 | } |
| | 1426 | #if LANG_JP |
| | 1427 | /// <summary> |
| | 1428 | /// ヒストグラムの比較に基づき画像内部でのテンプレート位置を求める |
| | 1429 | /// </summary> |
| | 1430 | /// <param name="image">入力画像群( CvMat** 形式でも構わない).すべて同じサイズ.</param> |
| | 1431 | /// <param name="dst">出力画像</param> |
| | 1432 | /// <param name="patch_size">入力画像群上をスライドさせるテンプレートのサイズ</param> |
| | 1433 | /// <param name="hist">テンプレートのヒストグラム</param> |
| | 1434 | /// <param name="method">比較方法.値は関数 cvCompareHist に渡される(この関数に関する記述を参照)</param> |
| | 1435 | /// <param name="factor">ヒストグラムの正規化係数.出力画像の正規化スケールに影響する.値に確信がない場合は,1にする.</param> |
| | 1436 | /// <returns></returns> |
| | 1437 | #else |
| | 1438 | /// <summary> |
| | 1439 | /// Locates a template within image by histogram comparison |
| | 1440 | /// </summary> |
| | 1441 | /// <param name="image">Source images (though you may pass CvMat** as well), all are of the same size and type </param> |
| | 1442 | /// <param name="dst">Destination image. </param> |
| | 1443 | /// <param name="patch_size">Size of patch slid though the source images. </param> |
| | 1444 | /// <param name="hist">Histogram. </param> |
| | 1445 | /// <param name="method">Compasion method, passed to cvCompareHist (see description of that function). </param> |
| | 1446 | /// <param name="factor">Normalization factor for histograms, will affect normalization scale of destination image, pass 1. if unsure. </param> |
| | 1447 | /// <returns></returns> |
| | 1448 | #endif |
| | 1449 | public static void CalcBackProjectPatch(CvArr[] image, CvArr dst, CvSize patch_size, CvHistogram hist, HistogramComparison method, float factor) |
| | 1450 | { |
| | 1451 | CalcArrBackProjectPatch(image, dst, patch_size, hist, method, factor); |