OSDN Git Service

[Backup]NyARToolkit for Java
[nyartoolkit-and/nyartoolkit-and.git] / trunk / src / jp / nyatla / nyartoolkit / detector / NyARDetectMarker.java
index 568d315..5c3f252 100644 (file)
@@ -112,14 +112,17 @@ public class NyARDetectMarker
         * i_codeのマーカーサイズをミリメートルで指定した配列を指定します。 先頭からi_number_of_code個の要素には、有効な値を指定する必要があります。\r
         * @param i_number_of_code\r
         * i_codeに含まれる、ARCodeの数を指定します。\r
+        * @param i_input_raster_type\r
+        * 入力ラスタのピクセルタイプを指定します。この値は、INyARBufferReaderインタフェイスのgetBufferTypeの戻り値を指定します。\r
         * @throws NyARException\r
         */\r
-       public NyARDetectMarker(NyARParam i_param,NyARCode[] i_code,double[] i_marker_width, int i_number_of_code) throws NyARException\r
+       public NyARDetectMarker(NyARParam i_param,NyARCode[] i_code,double[] i_marker_width, int i_number_of_code,int i_input_raster_type) throws NyARException\r
        {\r
                final NyARIntSize scr_size=i_param.getScreenSize();\r
                // 解析オブジェクトを作る\r
                this._square_detect = new NyARSquareDetector(i_param.getDistortionFactor(),scr_size);\r
                this._transmat = new NyARTransMat(i_param);\r
+               this._tobin_filter=new NyARRasterFilter_ARToolkitThreshold(100,i_input_raster_type);\r
 \r
                //各コード用の比較器を作る。\r
                this._match_patt=new NyARMatchPatt_Color_WITHOUT_PCA[i_number_of_code];\r
@@ -146,7 +149,7 @@ public class NyARDetectMarker
 \r
        private NyARBinRaster _bin_raster;\r
 \r
-       private NyARRasterFilter_ARToolkitThreshold _tobin_filter = new NyARRasterFilter_ARToolkitThreshold(100);\r
+       private NyARRasterFilter_ARToolkitThreshold _tobin_filter;\r
        private final NyARMatchPattResult __detectMarkerLite_mr=new NyARMatchPattResult();\r
 \r
        /**\r
@@ -186,7 +189,7 @@ public class NyARDetectMarker
 \r
                // 1スクエア毎に、一致するコードを決定していく\r
                for (int i = 0; i < number_of_square; i++) {\r
-                       NyARSquare square = (NyARSquare)l_square_list.getItem(i);\r
+                       NyARSquare square = (l_square_list.getItem(i));\r
 \r
                        // 評価基準になるパターンをイメージから切り出す\r
                        if (!this._patt.pickFromRaster(i_raster, square)) {\r