From ddd20b10306bf47117e6cd33be97df06f86d6500 Mon Sep 17 00:00:00 2001 From: nyatla Date: Fri, 7 Jan 2011 07:37:36 +0000 Subject: [PATCH] git-svn-id: http://svn.sourceforge.jp/svnroot/nyartoolkit/NyARToolkit/trunk@793 7cac0a50-4618-4814-88d0-24b83990f816 --- .../nyatla/nyartoolkit/core/INyARDisposable.java | 2 +- lib/src/jp/nyatla/nyartoolkit/core/NyARCode.java | 2 +- lib/src/jp/nyatla/nyartoolkit/core/NyARMat.java | 2 +- .../INyARHistogramAnalyzer_Threshold.java | 31 +++++- ...yARHistogramAnalyzer_DiscriminantThreshold.java | 43 +++++++-- .../NyARHistogramAnalyzer_KittlerThreshold.java | 33 ++++++- .../NyARHistogramAnalyzer_SlidePTile.java | 38 ++++++-- .../raster/NyARRasterAnalyzer_Histogram.java | 107 ++++++++++++++++++--- .../threshold/INyARRasterThresholdAnalyzer.java | 21 ++++ .../NyARRasterThresholdAnalyzer_SlidePTile.java | 65 ++++++++++++- .../nyartoolkit/core/labeling/NyARLabelInfo.java | 10 +- .../core/labeling/NyARLabelOverlapChecker.java | 30 +++--- .../detector/NyARCustomSingleDetectMarker.java | 106 ++++++++++++-------- .../nyartoolkit/detector/NyARDetectMarker.java | 62 ++++++++---- .../detector/NyARSingleDetectMarker.java | 91 ++++++++++++------ 15 files changed, 504 insertions(+), 139 deletions(-) diff --git a/lib/src/jp/nyatla/nyartoolkit/core/INyARDisposable.java b/lib/src/jp/nyatla/nyartoolkit/core/INyARDisposable.java index ceff0fc..7ab71c7 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/INyARDisposable.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/INyARDisposable.java @@ -31,7 +31,7 @@ package jp.nyatla.nyartoolkit.core; /** - * オブジェクト破棄のタイミングを受け取るインタフェイスです。 + * このインタフェイスは、オブジェクト破棄のタイミングを受け取る関数を定義します。 * アンマネージリソースの破棄コントロールや、オブジェクトプールの制御に使います。 */ public interface INyARDisposable diff --git a/lib/src/jp/nyatla/nyartoolkit/core/NyARCode.java b/lib/src/jp/nyatla/nyartoolkit/core/NyARCode.java index 7b4adde..707f2a5 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/NyARCode.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/NyARCode.java @@ -147,7 +147,7 @@ class NyARCodeFileReader } /** - * ARToolKitのマーカーパターン1個のデータを格納するクラスです。 + * このクラスは、ARToolKitのマーカーパターン1個のデータを格納します。 * マーカーパターンのプロパティと、データのロード機能を提供します。 */ public class NyARCode diff --git a/lib/src/jp/nyatla/nyartoolkit/core/NyARMat.java b/lib/src/jp/nyatla/nyartoolkit/core/NyARMat.java index f627667..e601fe9 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/NyARMat.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/NyARMat.java @@ -34,7 +34,7 @@ import jp.nyatla.nyartoolkit.NyARException; import jp.nyatla.nyartoolkit.core.types.matrix.*; /** - * 可変サイズの行列計算クラスです。 + * このクラスは、可変サイズの行列計算機能を提供します。 * ARToolKitのARMat構造体と、その処理関数に相当する機能があります。 * 2x2,3x3,4x4行列については、NyAToolKitの行列計算クラス({@link NyARDoubleMatrix44},{@link NyARDoubleMatrix33},{@link NyARDoubleMatrix22},) * がありますので、こちらを使ってください。 diff --git a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/INyARHistogramAnalyzer_Threshold.java b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/INyARHistogramAnalyzer_Threshold.java index 6b9a5a2..5b18c9e 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/INyARHistogramAnalyzer_Threshold.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/INyARHistogramAnalyzer_Threshold.java @@ -1,19 +1,42 @@ +/* + * PROJECT: NyARToolkit(Extension) + * -------------------------------------------------------------------------------- + * The NyARToolkit is Java edition ARToolKit class library. + * Copyright (C)2008-2009 Ryo Iizuka + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * For further information please contact. + * http://nyatla.jp/nyatoolkit/ + * or + * + */ package jp.nyatla.nyartoolkit.core.analyzer.histogram; import jp.nyatla.nyartoolkit.core.types.NyARHistogram; /** - * 敷居値判別ヒストグラム分析器の、標準的なインタフェイスを定義します。 - * + * このインタフェイスは、ヒストグラムから敷居値を探索する関数を定義します。 */ public interface INyARHistogramAnalyzer_Threshold { /** - * ヒストグラムから閾値探索をします。 + * ヒストグラムから閾値を1個探索する関数を実装します。 * @param i_histogram * 分析するヒストグラムオブジェクト * @return - * 敷居値を返します。 + * 敷居値を返します。値範囲は、{@link NyARHistogram}のプロパティから決定します。 */ public int getThreshold(NyARHistogram i_histogram); } diff --git a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_DiscriminantThreshold.java b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_DiscriminantThreshold.java index af81ed3..11e1bff 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_DiscriminantThreshold.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_DiscriminantThreshold.java @@ -1,18 +1,41 @@ +/* + * PROJECT: NyARToolkit(Extension) + * -------------------------------------------------------------------------------- + * The NyARToolkit is Java edition ARToolKit class library. + * Copyright (C)2008-2009 Ryo Iizuka + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * For further information please contact. + * http://nyatla.jp/nyatoolkit/ + * or + * + */ package jp.nyatla.nyartoolkit.core.analyzer.histogram; import jp.nyatla.nyartoolkit.core.types.NyARHistogram; /** - * 敷居値を求めるヒストグラム分析器です。 - * 判別法で閾値を求めます。 - * @note - * 画素数が2048^2に満たない場合は、fixedint(24-8)で計算できます。 + * このクラスは、判別法を用いて敷居値を求める機能を提供します。 + *

memo:画素数が2048^2に満たない場合は、fixedint(24-8)で計算できます。

*/ public class NyARHistogramAnalyzer_DiscriminantThreshold implements INyARHistogramAnalyzer_Threshold { private double _score; /** - * @override + * この関数は、判別法を用いて敷居値を1個求めます。敷居値の範囲は、i_histogram引数の範囲と同じです。 + * 関数は、thisのプロパティを更新します。 */ public int getThreshold(NyARHistogram i_histogram) { @@ -65,18 +88,18 @@ public class NyARHistogramAnalyzer_DiscriminantThreshold implements INyARHistogr return th; } /** - * 最後に実行したgetThresholdのスコアを返します。 - * スコアは正規化された分離度です。1.0>n>0.0の値を取ります。 - * 0.7以上なら概ね双峰的で有ることを示します。 + * 最後に実行した{@link #getThreshold}のスコアを返却します。 * @return - * 分離度 + * スコア値。範囲は0<=n<=1.0の間です。 */ public final double getLastScore() { return this._score; } /** - * Debug + * デバック用関数 + * @param args + * main関数引数 */ public static void main(String[] args) { diff --git a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_KittlerThreshold.java b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_KittlerThreshold.java index fd99fda..7e4352a 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_KittlerThreshold.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_KittlerThreshold.java @@ -1,15 +1,39 @@ +/* + * PROJECT: NyARToolkit(Extension) + * -------------------------------------------------------------------------------- + * The NyARToolkit is Java edition ARToolKit class library. + * Copyright (C)2008-2009 Ryo Iizuka + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * For further information please contact. + * http://nyatla.jp/nyatoolkit/ + * or + * + */ package jp.nyatla.nyartoolkit.core.analyzer.histogram; import jp.nyatla.nyartoolkit.core.types.NyARHistogram; /** - * kittlerThresholdの方式で閾値を求めます。 + * このクラスは、kittlerThresholdを用いて敷居値を求める機能を提供します。 */ public class NyARHistogramAnalyzer_KittlerThreshold implements INyARHistogramAnalyzer_Threshold { /** - * @override + * この関数は、kittlerThresholdを用いて敷居値を1個求めます。敷居値の範囲は、i_histogram引数の範囲と同じです。 */ public int getThreshold(NyARHistogram i_histogram) { @@ -74,6 +98,11 @@ public class NyARHistogramAnalyzer_KittlerThreshold implements INyARHistogramAna } return th;//129//7.506713872738873 } + /** + * デバック用関数 + * @param args + * main関数引数 + */ public static void main(String[] args) { NyARHistogram data=new NyARHistogram(256); diff --git a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_SlidePTile.java b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_SlidePTile.java index 369b12b..5fbd880 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_SlidePTile.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_SlidePTile.java @@ -1,14 +1,35 @@ +/* + * PROJECT: NyARToolkit(Extension) + * -------------------------------------------------------------------------------- + * The NyARToolkit is Java edition ARToolKit class library. + * Copyright (C)2008-2009 Ryo Iizuka + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * For further information please contact. + * http://nyatla.jp/nyatoolkit/ + * or + * + */ package jp.nyatla.nyartoolkit.core.analyzer.histogram; import jp.nyatla.nyartoolkit.core.types.NyARHistogram; - /** - * PTileを使った敷居値決定クラスです。 - * 明点と暗点を双方向からPTile法で敷居値を計算し、その中央値を閾値とします。 - * - * + * このクラスは、明点・暗点のPTail法で求めた敷居値を合算して、敷居値を計算します。 + *

敷居値決定のアルゴリズム - 明点・暗点両側からPTail法を用いて一定割合の画素を取り除き、その中間値を求めます。

*/ public class NyARHistogramAnalyzer_SlidePTile implements INyARHistogramAnalyzer_Threshold { @@ -16,14 +37,17 @@ public class NyARHistogramAnalyzer_SlidePTile implements INyARHistogramAnalyzer_ /** * コンストラクタです。 * @param i_persentage - * 敷居値とする、PTileのパーセンテージ値を指定します。 + * 明点、暗点の両側から取り除く、画素の割合を指定します。0<n<50の範囲で指定します。 */ public NyARHistogramAnalyzer_SlidePTile(int i_persentage) { assert (0 <= i_persentage && i_persentage <= 50); //初期化 this._persentage=i_persentage; - } + } + /** + * この関数は、SlidePTileを用いて敷居値を1個求めます。敷居値の範囲は、i_histogram引数の範囲と同じです。 + */ public int getThreshold(NyARHistogram i_histogram) { //総ピクセル数を計算 diff --git a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/NyARRasterAnalyzer_Histogram.java b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/NyARRasterAnalyzer_Histogram.java index a4540d0..b8822e5 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/NyARRasterAnalyzer_Histogram.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/NyARRasterAnalyzer_Histogram.java @@ -1,31 +1,74 @@ +/* + * PROJECT: NyARToolkit(Extension) + * -------------------------------------------------------------------------------- + * The NyARToolkit is Java edition ARToolKit class library. + * Copyright (C)2008-2009 Ryo Iizuka + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * For further information please contact. + * http://nyatla.jp/nyatoolkit/ + * or + * + */ package jp.nyatla.nyartoolkit.core.analyzer.raster; import jp.nyatla.nyartoolkit.NyARException; import jp.nyatla.nyartoolkit.core.raster.*; import jp.nyatla.nyartoolkit.core.raster.rgb.*; import jp.nyatla.nyartoolkit.core.types.*; + /** - * 画像のヒストグラムを計算します。 - * RGBの場合、(R+G+B)/3のヒストグラムを計算します。 - * - * + * このクラスは、グレースケール画像のヒストグラムを計算します。 + *

memo: RGB画像のグレースケール化は分離が必要?

*/ public class NyARRasterAnalyzer_Histogram { protected ICreateHistogramImpl _histImpl; /** - * ヒストグラム解析の縦方向スキップ数。継承クラスはこのライン数づつ - * スキップしながらヒストグラム計算を行うこと。 + * ヒストグラム解析の縦方向スキップ数。 + *

memo:継承クラスはこのライン数づつ、スキップしながらヒストグラム計算を行うこと。

*/ protected int _vertical_skip; - + /** + * コンストラクタです。 + * ラスタの画素フォーマットを指定して、ヒストグラム分析器を作ります。 + * @param i_raster_format + * 入力するラスタの画素フォーマットを指定します。 + * {@link NyARBufferType#INT1D_GRAY_8}形式以外の画素フォーマットの場合は、解析時にグレースケール化を行います。 + * @param i_vertical_interval + * 画素スキャン時の、Y軸方向のスキップ数を指定します。数値が大きいほど高速に解析できますが、精度は劣化します。0以上を指定してください。 + * @throws NyARException + */ public NyARRasterAnalyzer_Histogram(int i_raster_format,int i_vertical_interval) throws NyARException { if(!initInstance(i_raster_format,i_vertical_interval)){ throw new NyARException(); } } + /** + * インスタンスを初期化します。 + * 継承クラスを実装するときには、この関数をオーバライドしてください。 + * @see #NyARRasterAnalyzer_Histogram(int i_raster_format,int i_vertical_interval) + * @param i_raster_format + * see Also. + * @param i_vertical_interval + * see Also. + * @return + * インスタンスの初期化に成功するとTrueを返します。 + */ protected boolean initInstance(int i_raster_format,int i_vertical_interval) { switch (i_raster_format) { @@ -55,8 +98,11 @@ public class NyARRasterAnalyzer_Histogram this._vertical_skip=i_vertical_interval; return true; } - - + /** + * 画素スキャン時の、Y軸方向のスキップ数を指定します。 + * @param i_step + * 新しい行スキップ数 + */ public void setVerticalInterval(int i_step) { assert(this._vertical_skip>0); @@ -65,10 +111,11 @@ public class NyARRasterAnalyzer_Histogram } /** - * o_histogramにヒストグラムを出力します。 + * ラスタから、ヒストグラムを計算します。 * @param i_input + * 解析するラスタオブジェクト * @param o_histogram - * @return + * 解析結果を格納するヒストグラムオブジェクト。ヒストグラムの範囲は、256であること。 * @throws NyARException */ public void analyzeRaster(INyARRaster i_input,NyARHistogram o_histogram) throws NyARException @@ -88,6 +135,16 @@ public class NyARRasterAnalyzer_Histogram this._histImpl.createHistogram(i_input,0,0,size.w,size.h,o_histogram.data,this._vertical_skip); return; } + /** + * ラスタの一部分(矩形)から、ヒストグラムを計算します。 + * @param i_input + * 解析するラスタオブジェクト + * @param i_area + * 解析する矩形範囲。ラスタの内側である事が必要。 + * @param o_histogram + * 解析結果を格納するヒストグラムオブジェクト。ヒストグラムの範囲は、256であること。 + * @throws NyARException + */ public void analyzeRaster(INyARRaster i_input,NyARIntRect i_area,NyARHistogram o_histogram) throws NyARException { @@ -106,11 +163,31 @@ public class NyARRasterAnalyzer_Histogram return; } + /** + * このインタフェイスは、ヒストグラム解析関数を定義します。 + * このインタフェイスを継承して、画素フォーマット毎のヒストグラム解析関数を実装します。 + */ protected interface ICreateHistogramImpl { + /** + * この関数には、ラスタ内の矩形範囲からヒストグラムを作成する機能を実装します。 + * @param i_raster + * 解析するラスタオブジェクト + * @param i_l + * 矩形範囲 -L + * @param i_t + * 矩形範囲 -T + * @param i_w + * 矩形範囲 -W + * @param i_h + * 矩形範囲 -H + * @param o_histogram + * ヒストグラムを格納するオブジェクト + * @param i_skip + * 行スキップ数 + */ public void createHistogram(INyARRaster i_raster,int i_l,int i_t,int i_w,int i_h, int[] o_histogram,int i_skip); } - class NyARRasterThresholdAnalyzer_Histogram_INT1D_GRAY_8 implements ICreateHistogramImpl { public void createHistogram(INyARRaster i_raster,int i_l,int i_t,int i_w,int i_h, int[] o_histogram,int i_skip) @@ -337,7 +414,11 @@ public class NyARRasterAnalyzer_Histogram return; } } - + /** + * デバック用関数 + * @param args + * main関数引数 + */ public static void main(String[] args) { try{ diff --git a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/INyARRasterThresholdAnalyzer.java b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/INyARRasterThresholdAnalyzer.java index f316616..81581a0 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/INyARRasterThresholdAnalyzer.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/INyARRasterThresholdAnalyzer.java @@ -29,8 +29,29 @@ import jp.nyatla.nyartoolkit.NyARException; import jp.nyatla.nyartoolkit.core.raster.*; import jp.nyatla.nyartoolkit.core.types.*; +/** + * このインタフェイスは、ラスタの敷居値を分析する関数を定義します。 + */ public interface INyARRasterThresholdAnalyzer { + /** + * この関数には、ラスタ全体を調査して、敷居値を計算しまする関数を実装します。 + * @param i_input + * 調査するラスタオブジェクト。 + * @return + * 敷居値の値を返します。 + * @throws NyARException + */ public int analyzeRaster(INyARRaster i_input) throws NyARException; + /** + * この関数には、i_areaで定義するラスタの一部を調査して、敷居値を計算する関数を実装します。 + * @param i_input + * 調査するラスタオブジェクト。 + * @param i_area + * 調査を行う範囲を指定です。 + * @return + * 敷居値の値を返します。 + * @throws NyARException + */ public int analyzeRaster(INyARRaster i_input,NyARIntRect i_area) throws NyARException; } diff --git a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/NyARRasterThresholdAnalyzer_SlidePTile.java b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/NyARRasterThresholdAnalyzer_SlidePTile.java index 1dce534..db69da8 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/NyARRasterThresholdAnalyzer_SlidePTile.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/NyARRasterThresholdAnalyzer_SlidePTile.java @@ -1,3 +1,27 @@ +/* + * PROJECT: NyARToolkit(Extension) + * -------------------------------------------------------------------------------- + * The NyARToolkit is Java edition ARToolKit class library. + * Copyright (C)2008-2009 Ryo Iizuka + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * For further information please contact. + * http://nyatla.jp/nyatoolkit/ + * or + * + */ package jp.nyatla.nyartoolkit.core.analyzer.raster.threshold; import jp.nyatla.nyartoolkit.NyARException; @@ -6,21 +30,38 @@ import jp.nyatla.nyartoolkit.core.analyzer.raster.*; import jp.nyatla.nyartoolkit.core.raster.INyARRaster; import jp.nyatla.nyartoolkit.core.types.NyARHistogram; import jp.nyatla.nyartoolkit.core.types.NyARIntRect; + /** - * 明点と暗点をPタイル法で検出して、その中央値を閾値とする。 - * - * + * このクラスは、画像のヒストグラムから{@link NyARHistogramAnalyzer_SlidePTile}による敷居値検出をする機能を提供します。 */ public class NyARRasterThresholdAnalyzer_SlidePTile implements INyARRasterThresholdAnalyzer { + /** ヒストグラムオブジェクト*/ protected NyARRasterAnalyzer_Histogram _raster_analyzer; private NyARHistogramAnalyzer_SlidePTile _sptile; private NyARHistogram _histogram; + /** + * この関数は、ヒストグラム作成時の行スキップ数を指定します。 + * @see {@link NyARRasterAnalyzer_Histogram#setVerticalInterval} + * @param i_step + * 新しい行スキップ数 + */ public void setVerticalInterval(int i_step) { this._raster_analyzer.setVerticalInterval(i_step); return; } + /** + * コンストラクタ。 + * {@link NyARHistogramAnalyzer_SlidePTile}に渡すパラメータを指定して、敷居値分析器を作成します。 + * @param i_persentage + * {@link NyARHistogramAnalyzer_SlidePTile#NyARHistogramAnalyzer_SlidePTile}へ渡す分析パラメータです。 + * @param i_raster_format + * 分析するラスタの画素フォーマットです。 + * @param i_vertical_interval + * ヒストグラム作成時の行スキップ数です。 + * @throws NyARException + */ public NyARRasterThresholdAnalyzer_SlidePTile(int i_persentage,int i_raster_format,int i_vertical_interval) throws NyARException { assert (0 <= i_persentage && i_persentage <= 50); @@ -31,16 +72,34 @@ public class NyARRasterThresholdAnalyzer_SlidePTile implements INyARRasterThresh this._sptile=new NyARHistogramAnalyzer_SlidePTile(i_persentage); this._histogram=new NyARHistogram(256); } + /** + * この関数は、インスタンスの初期化関数です。 + * 継承クラスを作るときには、この関数をオーバライドします。 + * @param i_raster_format + * @see NyARRasterThresholdAnalyzer_SlidePTile#NyARRasterThresholdAnalyzer_SlidePTile(int, int, int) + * @param i_vertical_interval + * @see NyARRasterThresholdAnalyzer_SlidePTile#NyARRasterThresholdAnalyzer_SlidePTile(int, int, int) + * @return + * 初期化に成功すると、trueを返します。 + * @throws NyARException + */ protected boolean initInstance(int i_raster_format,int i_vertical_interval) throws NyARException { this._raster_analyzer=new NyARRasterAnalyzer_Histogram(i_raster_format,i_vertical_interval); return true; } + /** + * {@link NyARHistogramAnalyzer_SlidePTile}による敷居値分析を実行します。 + */ public int analyzeRaster(INyARRaster i_input) throws NyARException { this._raster_analyzer.analyzeRaster(i_input, this._histogram); return this._sptile.getThreshold(this._histogram); } + /** + * {@link NyARHistogramAnalyzer_SlidePTile}による敷居値分析を実行します。 + * この関数は未実装です。 + */ public int analyzeRaster(INyARRaster i_input,NyARIntRect i_area) throws NyARException { throw new NyARException(); diff --git a/lib/src/jp/nyatla/nyartoolkit/core/labeling/NyARLabelInfo.java b/lib/src/jp/nyatla/nyartoolkit/core/labeling/NyARLabelInfo.java index 74a85cd..632e114 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/labeling/NyARLabelInfo.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/labeling/NyARLabelInfo.java @@ -32,17 +32,25 @@ package jp.nyatla.nyartoolkit.core.labeling; /** - * + * このクラスは、ラべリング結果1個を格納するデータ型です。 + * ラベル1個の領域情報を格納します。 * */ public class NyARLabelInfo { + /** 領域の画素数*/ public int area; + /** 領域範囲の右端*/ public int clip_r; + /** 領域範囲の左端*/ public int clip_l; + /** 領域範囲の下端*/ public int clip_b; + /** 領域範囲の上端*/ public int clip_t; + /** 領域の中心位置(x)*/ public double pos_x; + /** 領域の中心位置(y)*/ public double pos_y; } diff --git a/lib/src/jp/nyatla/nyartoolkit/core/labeling/NyARLabelOverlapChecker.java b/lib/src/jp/nyatla/nyartoolkit/core/labeling/NyARLabelOverlapChecker.java index 7e4b033..6b52d26 100644 --- a/lib/src/jp/nyatla/nyartoolkit/core/labeling/NyARLabelOverlapChecker.java +++ b/lib/src/jp/nyatla/nyartoolkit/core/labeling/NyARLabelOverlapChecker.java @@ -34,16 +34,23 @@ import java.lang.reflect.Array; /** - * ラベル同士の重なり(内包関係)を調べるクラスです。 - * ラベルリストに内包するラベルを蓄積し、それにターゲットのラベルが内包されているか を確認します。 + * このクラスは、ラベル同士の重なり関係を調べる機能を提供します。 + * 重なりの判定アルゴリズムは、ARToolKitのそれと同一です。 + * 登録済のラベルリストに対して、調査対象のラベルが重なっているかを調べます。 */ public class NyARLabelOverlapChecker { private T[] _labels; private int _length; private Class _element_type; - /* - */ + /** + * コンストラクタです。 + * この関数は、NyARToolkitの矩形検出クラスから使います。 + * @param i_max_label + * リストの最大登録数 + * @param i_element_type + * リストのデータ型 + */ @SuppressWarnings("unchecked") public NyARLabelOverlapChecker(int i_max_label,Class i_element_type) { @@ -52,9 +59,9 @@ public class NyARLabelOverlapChecker } /** - * チェック対象のラベルを追加する。 - * + * この関数は、チェックリストにラベルの参照を追加します。 * @param i_label_ref + * 追加するラベルの参照値 */ public void push(T i_label_ref) { @@ -63,10 +70,11 @@ public class NyARLabelOverlapChecker } /** - * 現在リストにあるラベルと重なっているかを返す。 - * + * この関数は、チェックリストにあるラベルと、与えられたラベルが、重なっているかを調べます。 * @param i_label - * @return 何れかのラベルの内側にあるならばfalse,独立したラベルである可能性が高ければtrueです. + * 調査するラベル + * @return + * 何れかのラベルの内側にあるならばfalse,独立したラベルである可能性が高ければtrueです. */ public boolean check(T i_label) { @@ -87,9 +95,9 @@ public class NyARLabelOverlapChecker return true; } /** - * 最大i_max_label個のラベルを蓄積できるようにオブジェクトをリセットする - * + * チェックリストの最大数を変更します。 * @param i_max_label + * 新しいチェックリストの大きさを設定します。 */ @SuppressWarnings("unchecked") public void setMaxLabels(int i_max_label) diff --git a/lib/src/jp/nyatla/nyartoolkit/detector/NyARCustomSingleDetectMarker.java b/lib/src/jp/nyatla/nyartoolkit/detector/NyARCustomSingleDetectMarker.java index 62a6fb6..722b334 100644 --- a/lib/src/jp/nyatla/nyartoolkit/detector/NyARCustomSingleDetectMarker.java +++ b/lib/src/jp/nyatla/nyartoolkit/detector/NyARCustomSingleDetectMarker.java @@ -44,16 +44,12 @@ import jp.nyatla.nyartoolkit.core.types.*; import jp.nyatla.nyartoolkit.core.squaredetect.*; - - /** - * 画像からARCodeに最も一致するマーカーを1個検出し、その変換行列を計算するクラスです。 - * 変換行列を求めるには、detectMarkerLite関数にラスタイメージを入力して、計算対象の矩形を特定します。 - * detectMarkerLiteが成功すると、getTransmationMatrix等の関数が使用可能な状態になり、変換行列を求めることができます。 - * - * + * このクラスは、1個のマーカを取り扱うマーカ検出器のベースクラスです。 + * アプリケーションからは、このクラスを継承した{@link NyARSingleDetectMarker}を使います。 + * 登録した1個のARマーカに対応するマーカを入力画像から検出し、その変換行列と一致度を返します。 */ -public class NyARCustomSingleDetectMarker +public abstract class NyARCustomSingleDetectMarker { /** 一致率*/ private double _confidence; @@ -72,8 +68,11 @@ public class NyARCustomSingleDetectMarker private NyARIntPoint2d[] __ref_vertex=new NyARIntPoint2d[4]; /** - * 矩形が見付かるたびに呼び出されます。 - * 発見した矩形のパターンを検査して、方位を考慮した頂点データを確保します。 + * 内部関数です。 + * この関数は、thisの二次元矩形情報プロパティを更新します。 + * @param i_coord + * @param i_vertex_index + * @throws NyARException */ protected void updateSquareInfo(NyARIntCoordinates i_coord,int[] i_vertex_index) throws NyARException { @@ -118,18 +117,41 @@ public class NyARCustomSingleDetectMarker private boolean _is_continue = false; private NyARSquareContourDetector _square_detect; - protected INyARTransMat _transmat; - //画処理用 + private NyARRectOffset _offset; private NyARBinRaster _bin_raster; - protected INyARRasterFilter_Rgb2Bin _tobin_filter; + private INyARTransMat _transmat; - private NyARRectOffset _offset; + + //画処理用 + protected INyARRasterFilter_Rgb2Bin _tobin_filter; + /** + * コンストラクタです。 + * 実際の初期化は、継承クラスから、{@link #initInstance}関数をコールして実行します。 + */ protected NyARCustomSingleDetectMarker() { return; } + /** + * この関数は、インスタンスを初期化してます。 + * @param i_patt_inst + * パターン取得オブジェクトを指定します。この解像度は、i_ref_code引数の解像度と同一である必要があります。 + * @param i_sqdetect_inst + * 矩形検出器のオブジェクトを指定します。 + * @param i_transmat_inst + * 変換行列計算器のオブジェクトを指定します。 + * @param i_filter + * 画像の2値化オブジェクトを指定します。 + * @param i_ref_param + * カメラパラメータオブジェクトの参照値を指定します。 + * @param i_ref_code + * 検出するARマーカを格納したオブジェクトの参照値を指定します。 + * @param i_marker_width + * マーカノ物理サイズを、mm単位で指定します。 + * @throws NyARException + */ protected void initInstance( INyARColorPatt i_patt_inst, NyARSquareContourDetector i_sqdetect_inst, @@ -155,22 +177,19 @@ public class NyARCustomSingleDetectMarker this._offset=new NyARRectOffset(); this._offset.setSquare(i_marker_width); return; - } - - - /** - * i_imageにマーカー検出処理を実行し、結果を記録します。 - * + * この関数は、画像から登録済のマーカ検出を行います。 + * マーカの検出に成功すると、thisのプロパティにマーカの二次元位置を記録します。 + * 関数の成功後は、マーカの姿勢行列と、一致度を、それぞれ{@link #getTransmationMatrix}と{@link #getConfidence}から得ることができます。 * @param i_raster - * マーカーを検出するイメージを指定します。イメージサイズは、カメラパラメータ - * と一致していなければなりません。 - * @return マーカーが検出できたかを真偽値で返します。 + * マーカーを検出する画像。画像のサイズは、コンストラクタに指定した{@link NyARParam}オブジェクトと一致していなければなりません。 + * @return + * マーカーが検出できたかを、真偽値で返します。 * @throws NyARException */ - public boolean detectMarkerLite(INyARRgbRaster i_raster) throws NyARException + protected boolean detectMarkerLite(INyARRgbRaster i_raster) throws NyARException { //サイズチェック if(!this._bin_raster.getSize().isEqualSize(i_raster.getSize())){ @@ -191,12 +210,12 @@ public class NyARCustomSingleDetectMarker } return true; } + /** - * 検出したマーカーの変換行列を計算して、o_resultへ値を返します。 - * 直前に実行したdetectMarkerLiteが成功していないと使えません。 - * + * この関数は、検出したマーカーの変換行列を計算して、o_resultへ値を返します。 + * 直前に実行した{@link #detectMarkerLite}が成功していないと使えません。 * @param o_result - * 変換行列を受け取るオブジェクトを指定します。 + * 変換行列を受け取るオブジェクト。 * @throws NyARException */ public void getTransmationMatrix(NyARTransMatResult o_result) throws NyARException @@ -210,26 +229,35 @@ public class NyARCustomSingleDetectMarker return; } /** - * 現在の矩形を返します。 + * この関数は、マーカーの画像上の位置を格納する、{@link NyARSquare}への参照値を返します。 + * 直前に実行した{@link #detectMarkerLite}が成功していないと使えません。 + * 返却値の内容は、次に{@link #detectMarkerLite}を実行するまで有効です。 * @return + * 矩形情報への参照値。 */ public NyARSquare refSquare() { return this._square; } /** - * 検出したマーカーの一致度を返します。 - * - * @return マーカーの一致度を返します。0~1までの値をとります。 一致度が低い場合には、誤認識の可能性が高くなります。 - * @throws NyARException + * この関数は、検出したマーカーと登録済パターンとの、一致度を返します。 + * 直前に実行した{@link #detectMarkerLite}が成功していないと使えません。 + * 値は、0<=n<1の間の数値を取ります。 + * 一般的に、一致度が低い場合は、マーカを誤認識しています。 + * @return + * 一致度の数値。 */ public double getConfidence() { return this._confidence; } /** - * getTransmationMatrixの計算モードを設定します。 初期値はTRUEです。 - * + * この関数は、変換行列の計算モードを切り替えます。 + * 通常はtrueを使用します。 + * transMat互換の計算は、姿勢の初期値を毎回二次元座標から計算するため、負荷が安定します。 + * transMatCont互換の計算は、姿勢の初期値に前回の結果を流用します。このモードは、姿勢の安定したマーカに対しては + * ジッタの減少や負荷減少などの効果がありますが、姿勢の安定しないマーカや複数のマーカを使用する環境では、 + * 少量の負荷変動があります。 * @param i_is_continue * TRUEなら、transMatCont互換の計算をします。 FALSEなら、transMat互換の計算をします。 */ @@ -238,7 +266,8 @@ public class NyARCustomSingleDetectMarker this._is_continue = i_is_continue; } /** - * プローブ関数 + * デバック関数。 + * privateメンバにアクセスするためのトンネルです。 * @return */ public Object[] _getProbe() @@ -246,8 +275,5 @@ public class NyARCustomSingleDetectMarker Object[] r=new Object[1]; r[0]=this._inst_patt; return r; - } - - - + } } diff --git a/lib/src/jp/nyatla/nyartoolkit/detector/NyARDetectMarker.java b/lib/src/jp/nyatla/nyartoolkit/detector/NyARDetectMarker.java index 0743ac0..4c68292 100644 --- a/lib/src/jp/nyatla/nyartoolkit/detector/NyARDetectMarker.java +++ b/lib/src/jp/nyatla/nyartoolkit/detector/NyARDetectMarker.java @@ -47,14 +47,24 @@ import jp.nyatla.nyartoolkit.core.types.stack.NyARObjectStack; - - /** - * 複数のマーカーを検出し、それぞれに最も一致するARコードを、コンストラクタで登録したARコードから 探すクラスです。最大300個を認識しますが、ゴミラベルを認識したりするので100個程度が限界です。 - * + * このクラスは、複数のマーカを取り扱うマーカ検出器です。 + * 登録したn個のARマーカに対応するマーカを入力画像から検出し、その変換行列と一致度を返します。 + * この関数はn個の登録したマーカに対して、画像中のm個のマーカから、最も位置するものを割り当てる動作をします。 + * そのため、同一な種類(パターン)のマーカが複数存在する映像を、正しく処理できません。また、同一なマーカパターンを + * 複数登録することもできません。 + *

簡単な使い方 + *

    + *
  1. インスタンスを作成します。パラメータには、計算アルゴリズムと入力画像形式、カメラパラメータ、検出するマーカパターンテーブルがあります。 + *
  2. {@link #detectMarkerLite}関数に画像と敷居値を入力して、マーカを検出します。 + *
  3. 検出数が得られるので、インデクス番号を元に、{@link #getConfidence}等の関数を使って、取得したマーカの状態を得ます。 + *
  4. 以降は、この処理を繰り返してマーカのパラメータを更新します。 + *
+ *

*/ public class NyARDetectMarker { + /** 矩形検出器のブリッジ*/ private class RleDetector extends NyARSquareContourDetector_Rle { //公開プロパティ @@ -152,29 +162,29 @@ public class NyARDetectMarker this.result_stack.clear(); } - } + } + /** 変換行列計算器のインスタンス*/ + private INyARTransMat _transmat; private static final int AR_SQUARE_MAX = 300; private boolean _is_continue = false; private RleDetector _square_detect; - protected INyARTransMat _transmat; private NyARRectOffset[] _offset; - /** - * 複数のマーカーを検出し、最も一致するARCodeをi_codeから検索するオブジェクトを作ります。 - * + * コンストラクタです。 + * パターンの重複しない複数のマーカを検出する検出器を作成します。 * @param i_param - * カメラパラメータを指定します。 + * カメラパラメータを指定します。このサイズは、{@link #detectMarkerLite}に入力する画像と同じである必要があります。 * @param i_code - * 検出するマーカーのARCode配列を指定します。 - * 配列要素のインデックス番号が、そのままgetARCodeIndex関数で得られるARCodeインデックスになります。 - * 例えば、要素[1]のARCodeに一致したマーカーである場合は、getARCodeIndexは1を返します。 + * 検出するマーカーパターンを格納した、{@link NyARCode}の配列を指定します。配列には、先頭から、0から始まるインデクス番号が割り当てられます。 + * このインデクス番号は、{@link #getConfidence(int)}等のインデクス番号に使います。 * @param i_marker_width - * i_codeのマーカーサイズをミリメートルで指定した配列を指定します。 先頭からi_number_of_code個の要素には、有効な値を指定する必要があります。 + * 正方形マーカの物理サイズをmm単位で指定します。 * @param i_number_of_code - * i_codeに含まれる、ARCodeの数を指定します。 + * i_codeの有効な個数を指定します。 * @param i_input_raster_type - * 入力ラスタのピクセルタイプを指定します。この値は、INyARBufferReaderインタフェイスのgetBufferTypeの戻り値を指定します。 + * {@link #detectMarkerLite}に入力するラスタのバッファフォーマットを指定します。 + * この値は、{@link INyARRgbRaster#getBufferType}関数の戻り値を利用します。 * @throws NyARException */ public NyARDetectMarker(NyARParam i_param,NyARCode[] i_code,double[] i_marker_width, int i_number_of_code,int i_input_raster_type) throws NyARException @@ -182,6 +192,22 @@ public class NyARDetectMarker initInstance(i_param,i_code,i_marker_width,i_number_of_code,i_input_raster_type); return; } + /** + * この関数は、インスタンスを初期化します。 + * コンストラクタから呼び出します。 + * @see NyARDetectMarker#NyARDetectMarker(NyARParam, NyARCode[], double[], int, int) + * @param i_ref_param + * Check see also + * @param i_ref_code + * Check see also + * @param i_marker_width + * Check see also + * @param i_number_of_code + * Check see also + * @param i_input_raster_type + * Check see also + * @throws NyARException + */ protected void initInstance( NyARParam i_ref_param, NyARCode[] i_ref_code, @@ -216,7 +242,7 @@ public class NyARDetectMarker /** * i_imageにマーカー検出処理を実行し、結果を記録します。 - * + * ここからん * @param i_raster * マーカーを検出するイメージを指定します。 * @param i_thresh @@ -300,6 +326,7 @@ public class NyARDetectMarker } } +/** 内部クラスです。ユーザが使用することはありません*/ class NyARDetectMarkerResult { public int arcode_id; @@ -309,6 +336,7 @@ class NyARDetectMarkerResult } +/** 内部クラスです。ユーザが使用することはありません*/ class NyARDetectMarkerResultStack extends NyARObjectStack { public NyARDetectMarkerResultStack(int i_length) throws NyARException diff --git a/lib/src/jp/nyatla/nyartoolkit/detector/NyARSingleDetectMarker.java b/lib/src/jp/nyatla/nyartoolkit/detector/NyARSingleDetectMarker.java index 64862a5..04795f4 100644 --- a/lib/src/jp/nyatla/nyartoolkit/detector/NyARSingleDetectMarker.java +++ b/lib/src/jp/nyatla/nyartoolkit/detector/NyARSingleDetectMarker.java @@ -41,22 +41,34 @@ import jp.nyatla.nyartoolkit.core.squaredetect.*; import jp.nyatla.nyartoolkit.core.pickup.*; import jp.nyatla.nyartoolkit.core.types.*; import jp.nyatla.nyartoolkit.core.transmat.*; + /** - * 画像からARCodeに最も一致するマーカーを1個検出し、その変換行列を計算するクラスです。 - * + * このクラスは、1個のマーカを取り扱うマーカ検出器です。 + * 登録した1個のARマーカに対応するマーカを入力画像から検出し、その変換行列と一致度を返します。 + *

簡単な使い方 + *

    + *
  1. インスタンスを作成します。パラメータには、計算アルゴリズムと入力画像形式、カメラパラメータ、検出するマーカがあります。 + *
  2. {@link #detectMarkerLite}関数に画像と敷居値を入力して、マーカを検出します。 + *
  3. マーカが見つかると、インスタンスのプロパティが更新されます。{@link #getConfidence}等の関数を使って、取得したマーカの状態を得ます。 + *
  4. 以降は、この処理を繰り返してマーカのパラメータを更新します。 + *
+ *

*/ public class NyARSingleDetectMarker extends NyARCustomSingleDetectMarker { + /** ARToolKit互換のアルゴリズムを選択します。*/ public final static int PF_ARTOOLKIT_COMPATIBLE=1; + /** NyARToolKitのアルゴリズムを選択します。*/ public final static int PF_NYARTOOLKIT=2; + /** ARToolKit互換アルゴリズムと、NyARToolKitのアルゴリズムの混合です。2D系にNyARToolkit,3D系にARToolKitのアルゴリズムを選択します。*/ public final static int PF_NYARTOOLKIT_ARTOOLKIT_FITTING=100; + /** 開発用定数値*/ public final static int PF_TEST2=201; /** - * Rleラ矩形Detectorのブリッジ - * + * RleLabelingを使った矩形検出機 */ - class RleDetector extends NyARSquareContourDetector_Rle + private class RleDetector extends NyARSquareContourDetector_Rle { NyARCustomSingleDetectMarker _parent; public RleDetector(NyARCustomSingleDetectMarker i_parent,NyARIntSize i_size) throws NyARException @@ -70,8 +82,7 @@ public class NyARSingleDetectMarker extends NyARCustomSingleDetectMarker } } /** - * ARTK矩形Detectorのブリッジ - * + * ARTKラべリングを使った矩形検出機へのブリッジ */ class ARTKDetector extends NyARSquareContourDetector_ARToolKit { @@ -87,25 +98,25 @@ public class NyARSingleDetectMarker extends NyARCustomSingleDetectMarker } } - - - - - - - - /** - * 検出するARCodeとカメラパラメータから、1個のARCodeを検出するNyARSingleDetectMarkerインスタンスを作ります。 - * + * コンストラクタです。 + * 指定した1種のマーカを1個検出するインスタンスを作ります。 * @param i_param - * カメラパラメータを指定します。 + * カメラパラメータを指定します。このサイズは、{@link #detectMarker}に入力する画像と同じである必要があります。 * @param i_code - * 検出するARCodeを指定します。 + * 検出するマーカパターンを指定します。 * @param i_marker_width - * ARコードの物理サイズを、ミリメートルで指定します。 + * 正方形マーカの物理サイズをmm単位で指定します。 * @param i_input_raster_type - * 入力ラスタのピクセルタイプを指定します。この値は、INyARBufferReaderインタフェイスのgetBufferTypeの戻り値を指定します。 + * {@link #detectMarker}に入力するラスタのバッファフォーマットを指定します。 + * この値は、{@link INyARRgbRaster#getBufferType}関数の戻り値を利用します。 + * @param i_profile_id + * 計算アルゴリズムの選択値です。以下の定数のいずれかを指定します。 + *
    + *
  • {@link NyARSingleDetectMarker#PF_ARTOOLKIT_COMPATIBLE} + *
  • {@link NyARSingleDetectMarker#PF_NYARTOOLKIT} + *
  • {@link NyARSingleDetectMarker#PF_NYARTOOLKIT_ARTOOLKIT_FITTING} + *
* @throws NyARException */ public NyARSingleDetectMarker(NyARParam i_param, NyARCode i_code, double i_marker_width,int i_input_raster_type,int i_profile_id) throws NyARException @@ -114,6 +125,21 @@ public class NyARSingleDetectMarker extends NyARCustomSingleDetectMarker initialize(i_param,i_code,i_marker_width,i_input_raster_type,i_profile_id); return; } + /** + * コンストラクタです。 + * 指定した1種のマーカを1個検出するインスタンスを作ります。 + * i_profile_idに{@link NyARSingleDetectMarker#PF_NYARTOOLKIT}を選択した{@link NyARSingleDetectMarker#NyARSingleDetectMarker(NyARParam, NyARCode, double, int, int)と同じです。 + * @see NyARSingleDetectMarker#NyARSingleDetectMarker(NyARParam, NyARCode, double, int, int) + * @param i_param + * Check see also + * @param i_code + * Check see also + * @param i_marker_width + * Check see also + * @param i_input_raster_type + * Check see also + * @throws NyARException + */ public NyARSingleDetectMarker(NyARParam i_param, NyARCode i_code, double i_marker_width,int i_input_raster_type) throws NyARException { super(); @@ -121,12 +147,19 @@ public class NyARSingleDetectMarker extends NyARCustomSingleDetectMarker return; } /** - * コンストラクタから呼び出す関数です。 + * この関数は、インスタンスを初期化します。 + * 引数は、{@link NyARSingleDetectMarker#NyARSingleDetectMarker}の対応する引数と同じです。 + * @see NyARSingleDetectMarker#NyARSingleDetectMarker(NyARParam, NyARCode, double, int, int) * @param i_ref_param + * Check see also * @param i_ref_code + * Check see also * @param i_marker_width + * Check see also * @param i_input_raster_type + * Check see also * @param i_profile_id + * Check see also * @throws NyARException */ private void initialize( @@ -164,14 +197,16 @@ public class NyARSingleDetectMarker extends NyARCustomSingleDetectMarker super.initInstance(patt_inst,sqdetect_inst,transmat_inst,th,i_ref_param,i_ref_code,i_marker_width); } - /** - * i_imageにマーカー検出処理を実行し、結果を記録します。 - * + * この関数は、画像からマーカを検出します。 + * 関数は、画像の二値化、ラべリング、矩形検出、パターンの一致判定処理までを行い、画像中にある最も一致したパターンを持つ矩形の座標を、thisの + * プロパティへ保管します。 * @param i_raster - * マーカーを検出するイメージを指定します。イメージサイズは、コンストラクタで指定i_paramの - * スクリーンサイズと一致し、かつi_input_raster_typeに指定した形式でなければいけません。 - * @return マーカーが検出できたかを真偽値で返します。 + * 検出元の画像を指定します。この画像は、コンストラクタで指定したものと同じサイズ、画素フォーマットに限られます。 + * @param i_threshold + * 二値化の敷居値を指定します。0<=n<256の間で指定します。 + * @return + * マーカの検出に成功すると、trueを返します。 * @throws NyARException */ public boolean detectMarkerLite(INyARRgbRaster i_raster,int i_threshold) throws NyARException -- 2.11.0