OSDN Git Service

git-svn-id: http://svn.sourceforge.jp/svnroot/nyartoolkit/NyARToolkit/trunk@757 7cac0...
authornyatla <nyatla@7cac0a50-4618-4814-88d0-24b83990f816>
Fri, 31 Dec 2010 02:21:01 +0000 (02:21 +0000)
committerAtsuo Igarashi <atsuoigarashi@ubuntu.(none)>
Tue, 5 Apr 2011 08:49:21 +0000 (17:49 +0900)
lib/test/jp/nyatla/nyartoolkit/test/NyIdTest.java [deleted file]
lib/test/jp/nyatla/nyartoolkit/test/RawFileTest.java [deleted file]
lib/test/jp/nyatla/nyartoolkit/test/RpfTest.java [deleted file]
lib/test/jp/nyatla/nyartoolkit/test/SingleARMarkerTest.java [deleted file]

diff --git a/lib/test/jp/nyatla/nyartoolkit/test/NyIdTest.java b/lib/test/jp/nyatla/nyartoolkit/test/NyIdTest.java
deleted file mode 100644 (file)
index 32530bd..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/* \r
- * PROJECT: NyARToolkit\r
- * --------------------------------------------------------------------------------\r
- * This work is based on the original ARToolKit developed by\r
- *   Hirokazu Kato\r
- *   Mark Billinghurst\r
- *   HITLab, University of Washington, Seattle\r
- * http://www.hitl.washington.edu/artoolkit/\r
- *\r
- * The NyARToolkit is Java edition ARToolKit class library.\r
- * Copyright (C)2008-2009 Ryo Iizuka\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- * \r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- * \r
- * For further information please contact.\r
- *     http://nyatla.jp/nyatoolkit/\r
- *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
- * \r
- */\r
-package jp.nyatla.nyartoolkit.test;\r
-\r
-import java.io.*;\r
-\r
-\r
-import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
-import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
-import jp.nyatla.nyartoolkit.core.transmat.*;\r
-import jp.nyatla.nyartoolkit.nyidmarker.data.*;\r
-import jp.nyatla.nyartoolkit.processor.*;\r
-\r
-/**\r
- * 320x240のBGRA32で記録されたIdmarkerを撮影したRAWイメージから、\r
- * Idマーカを認識します。\r
- *\r
- */\r
-public class NyIdTest\r
-{\r
-    public class MarkerProcessor extends SingleNyIdMarkerProcesser\r
-    {\r
-        private Object _sync_object = new Object();\r
-        public NyARTransMatResult transmat = null;\r
-        public int current_id = -1;\r
-\r
-        public MarkerProcessor(NyARParam i_cparam, int i_raster_format) throws Exception\r
-        {\r
-               super();//\r
-            initInstance(i_cparam, new NyIdMarkerDataEncoder_RawBit(),100, i_raster_format);\r
-            //アプリケーションフレームワークの初期化\r
-            return;\r
-        }\r
-        /**\r
-         * アプリケーションフレームワークのハンドラ(マーカ出現)\r
-         */\r
-        protected void onEnterHandler(INyIdMarkerData i_code)\r
-        {\r
-            synchronized (this._sync_object)\r
-            {\r
-                NyIdMarkerData_RawBit code = (NyIdMarkerData_RawBit)i_code;\r
-                if (code.length > 4)\r
-                {\r
-                    //4バイト以上の時はint変換しない。\r
-                    this.current_id = -1;//undefined_id\r
-                }\r
-                else\r
-                {\r
-                    this.current_id = 0;\r
-                    //最大4バイト繋げて1個のint値に変換\r
-                    for (int i = 0; i < code.length; i++)\r
-                    {\r
-                        this.current_id = (this.current_id << 8) | code.packet[i];\r
-                    }\r
-                    System.out.println("NyARId:"+this.current_id);\r
-                }\r
-                this.transmat = null;\r
-            }\r
-        }\r
-        /**\r
-         * アプリケーションフレームワークのハンドラ(マーカ消滅)\r
-         */\r
-        protected void onLeaveHandler()\r
-        {\r
-               synchronized (this._sync_object)\r
-            {\r
-                this.current_id = -1;\r
-                this.transmat = null;\r
-            }\r
-            return;\r
-        }\r
-        /**\r
-         * アプリケーションフレームワークのハンドラ(マーカ更新)\r
-         */\r
-        protected void onUpdateHandler(NyARSquare i_square, NyARTransMatResult result)\r
-        {\r
-               synchronized (this._sync_object)\r
-            {\r
-                this.transmat = result;\r
-            }\r
-        }\r
-    }\r
-       private final String data_file = "../Data/320x240NyId.raw";\r
-       private final String camera_file = "../Data/camera_para.dat";\r
-    public NyIdTest()\r
-    {\r
-    }\r
-    public void Test() throws Exception\r
-    {\r
-        //AR用カメラパラメタファイルをロード\r
-        NyARParam ap = new NyARParam();\r
-        ap.loadARParamFromFile(camera_file);\r
-        ap.changeScreenSize(320, 240);\r
-\r
-               // 試験イメージの読み出し(320x240 BGRAのRAWデータ)\r
-               File f = new File(data_file);\r
-               FileInputStream fs = new FileInputStream(data_file);\r
-               byte[] buf = new byte[(int) f.length()];\r
-               fs.read(buf);           \r
-\r
-        NyARRgbRaster_RGB ra = new NyARRgbRaster_RGB(320, 240,false);\r
-        ra.wrapBuffer(buf);\r
-\r
-        MarkerProcessor pr = new MarkerProcessor(ap, ra.getBufferType());\r
-        pr.detectMarker(ra);\r
-        return;\r
-    }\r
-       public static void main(String[] args)\r
-       {\r
-\r
-               try {\r
-                       NyIdTest t = new NyIdTest();\r
-                       // t.Test_arGetVersion();\r
-                       t.Test();\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-       }    \r
-}\r
diff --git a/lib/test/jp/nyatla/nyartoolkit/test/RawFileTest.java b/lib/test/jp/nyatla/nyartoolkit/test/RawFileTest.java
deleted file mode 100644 (file)
index 2a01a05..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/* \r
- * PROJECT: NyARToolkit\r
- * --------------------------------------------------------------------------------\r
- * This work is based on the original ARToolKit developed by\r
- *   Hirokazu Kato\r
- *   Mark Billinghurst\r
- *   HITLab, University of Washington, Seattle\r
- * http://www.hitl.washington.edu/artoolkit/\r
- *\r
- * The NyARToolkit is Java edition ARToolKit class library.\r
- * Copyright (C)2008-2009 Ryo Iizuka\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- * \r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- * \r
- * For further information please contact.\r
- *     http://nyatla.jp/nyatoolkit/\r
- *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
- * \r
- */\r
-package jp.nyatla.nyartoolkit.test;\r
-\r
-import java.io.*;\r
-import java.util.*;\r
-\r
-import jp.nyatla.nyartoolkit.core.*;\r
-import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
-import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
-import jp.nyatla.nyartoolkit.core.transmat.*;\r
-import jp.nyatla.nyartoolkit.detector.NyARSingleDetectMarker;\r
-import jp.nyatla.nyartoolkit.core.types.*;\r
-\r
-/**\r
- * 320x240のBGRA32で記録されたRAWイメージから、1種類のパターンを認識し、\r
- * その変換行列を1000回求め、それにかかったミリ秒時間を表示します。\r
- * \r
- */\r
-public class RawFileTest\r
-{\r
-       private final String code_file = "../Data/patt.hiro";\r
-\r
-       private final String data_file = "../Data/320x240ABGR.raw";\r
-\r
-       private final String camera_file = "../Data/camera_para.dat";\r
-\r
-       public RawFileTest()\r
-       {\r
-       }\r
-\r
-\r
-       public void Test_arDetectMarkerLite() throws Exception\r
-       {\r
-               // AR用カメラパラメタファイルをロード\r
-               NyARParam ap = new NyARParam();\r
-               ap.loadARParamFromFile(camera_file);\r
-               ap.changeScreenSize(320, 240);\r
-\r
-               // AR用のパターンコードを読み出し\r
-               NyARCode code = new NyARCode(16, 16);\r
-               code.loadARPattFromFile(code_file);\r
-\r
-               // 試験イメージの読み出し(320x240 BGRAのRAWデータ)\r
-               File f = new File(data_file);\r
-               FileInputStream fs = new FileInputStream(data_file);\r
-               byte[] buf = new byte[(int) f.length()];\r
-               fs.read(buf);\r
-               INyARRgbRaster ra = new NyARRgbRaster_BGRA(320, 240,false);\r
-               ra.wrapBuffer(buf);\r
-               // Blank_Raster ra=new Blank_Raster(320, 240);\r
-\r
-               // 1パターンのみを追跡するクラスを作成\r
-               NyARSingleDetectMarker ar = new NyARSingleDetectMarker(\r
-                               ap, code, 80.0,ra.getBufferType(),NyARSingleDetectMarker.PF_NYARTOOLKIT);\r
-               NyARTransMatResult result_mat = new NyARTransMatResult();\r
-               ar.setContinueMode(true);\r
-               ar.detectMarkerLite(ra, 100);\r
-               ar.getTransmationMatrix(result_mat);\r
-\r
-               // マーカーを検出\r
-               Date d2 = new Date();\r
-               for (int i = 0; i < 1000; i++) {\r
-                       // 変換行列を取得\r
-                       ar.detectMarkerLite(ra, 100);\r
-                       ar.getTransmationMatrix(result_mat);\r
-               }\r
-               Date d = new Date();\r
-               NyARDoublePoint3d ang=new NyARDoublePoint3d();\r
-               result_mat.getZXYAngle(ang);\r
-               System.out.println(d.getTime() - d2.getTime());\r
-               System.out.print(               ar.getConfidence());\r
-       }\r
-\r
-       public static void main(String[] args)\r
-       {\r
-\r
-               try {\r
-                       RawFileTest t = new RawFileTest();\r
-                       // t.Test_arGetVersion();\r
-                       t.Test_arDetectMarkerLite();\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-}\r
diff --git a/lib/test/jp/nyatla/nyartoolkit/test/RpfTest.java b/lib/test/jp/nyatla/nyartoolkit/test/RpfTest.java
deleted file mode 100644 (file)
index 78fe55f..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-package jp.nyatla.nyartoolkit.test;\r
-\r
-\r
-import java.io.File;\r
-import java.io.FileInputStream;\r
-import java.util.Date;\r
-\r
-import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
-import jp.nyatla.nyartoolkit.core.types.NyARBufferType;\r
-import jp.nyatla.nyartoolkit.core.types.NyARDoublePoint3d;\r
-import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARReality;\r
-import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTarget;\r
-import jp.nyatla.nyartoolkit.rpf.realitysource.nyartk.NyARRealitySource;\r
-import jp.nyatla.nyartoolkit.rpf.realitysource.nyartk.NyARRealitySource_Reference;\r
-\r
-\r
-\r
-\r
-\r
-\r
-/**\r
- * NyARRealityのテストプログラム。動作保証なし。\r
- * \r
- * ターゲットプロパティの取得実験用のテストコードです。\r
- * クリックしたマーカや、その平面周辺から、画像を取得するテストができます。\r
- *\r
- */\r
-\r
-public class RpfTest\r
-{\r
-       private final static String PARAM_FILE = "../Data/camera_para.dat";\r
-       private final static String DATA_FILE = "../Data/320x240ABGR.raw";\r
-       private static final long serialVersionUID = -2110888320986446576L;\r
-\r
-    \r
-       public static void main(String[] args)\r
-       {\r
-\r
-               try {\r
-                       NyARParam param=new NyARParam();\r
-                       param.loadARParamFromFile(PARAM_FILE);\r
-                       param.changeScreenSize(320,240);\r
-                       NyARReality reality=new NyARReality(param.getScreenSize(),10,1000,param.getPerspectiveProjectionMatrix(),null,10,10);\r
-                       NyARRealitySource reality_in=new NyARRealitySource_Reference(320,240,null,2,100,NyARBufferType.BYTE1D_B8G8R8X8_32);\r
-                       FileInputStream fs = new FileInputStream(DATA_FILE);\r
-                       fs.read((byte[])reality_in.refRgbSource().getBuffer());\r
-                       Date d2 = new Date();\r
-                       for(int i=0;i<1000;i++){\r
-                               reality.progress(reality_in);\r
-                       }\r
-                       Date d = new Date();\r
-                       System.out.println(d.getTime() - d2.getTime()+"ms");\r
-                       \r
-                       System.out.println(reality.getNumberOfKnown());\r
-                       System.out.println(reality.getNumberOfUnknown());\r
-                       System.out.println(reality.getNumberOfDead());\r
-                       NyARRealityTarget rt[]=new NyARRealityTarget[10];\r
-                       reality.selectUnKnownTargets(rt);\r
-                       reality.changeTargetToKnown(rt[0],2,80);\r
-                       System.out.println(rt[0]._transform_matrix.m00+","+rt[0]._transform_matrix.m01+","+rt[0]._transform_matrix.m02+","+rt[0]._transform_matrix.m03);\r
-                       System.out.println(rt[0]._transform_matrix.m10+","+rt[0]._transform_matrix.m11+","+rt[0]._transform_matrix.m12+","+rt[0]._transform_matrix.m13);\r
-                       System.out.println(rt[0]._transform_matrix.m20+","+rt[0]._transform_matrix.m21+","+rt[0]._transform_matrix.m22+","+rt[0]._transform_matrix.m23);\r
-                       System.out.println(rt[0]._transform_matrix.m30+","+rt[0]._transform_matrix.m31+","+rt[0]._transform_matrix.m32+","+rt[0]._transform_matrix.m33);\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/lib/test/jp/nyatla/nyartoolkit/test/SingleARMarkerTest.java b/lib/test/jp/nyatla/nyartoolkit/test/SingleARMarkerTest.java
deleted file mode 100644 (file)
index fdd4fa7..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/* \r
- * PROJECT: NyARToolkit\r
- * --------------------------------------------------------------------------------\r
- * This work is based on the original ARToolKit developed by\r
- *   Hirokazu Kato\r
- *   Mark Billinghurst\r
- *   HITLab, University of Washington, Seattle\r
- * http://www.hitl.washington.edu/artoolkit/\r
- *\r
- * The NyARToolkit is Java edition ARToolKit class library.\r
- * Copyright (C)2008-2009 Ryo Iizuka\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- * \r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- * \r
- * For further information please contact.\r
- *     http://nyatla.jp/nyatoolkit/\r
- *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
- * \r
- */\r
-package jp.nyatla.nyartoolkit.test;\r
-\r
-import java.io.*;\r
-\r
-\r
-import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
-import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
-import jp.nyatla.nyartoolkit.core.transmat.*;\r
-import jp.nyatla.nyartoolkit.core.*;\r
-import jp.nyatla.nyartoolkit.processor.*;\r
-\r
-public class SingleARMarkerTest\r
-{\r
-       class MarkerProcessor extends SingleARMarkerProcesser\r
-       {       \r
-               private Object _sync_object=new Object();\r
-               public NyARTransMatResult transmat=null;\r
-               public int current_code=-1;\r
-\r
-               public MarkerProcessor(NyARParam i_cparam,int i_raster_format) throws NyARException\r
-               {\r
-                       //アプリケーションフレームワークの初期化\r
-                       super();\r
-                       initInstance(i_cparam,i_raster_format);\r
-                       return;\r
-               }\r
-               protected void onEnterHandler(int i_code)\r
-               {\r
-                       synchronized(this._sync_object){\r
-                               current_code=i_code;\r
-                       }\r
-                       System.out.println("Marker Number:"+i_code);\r
-               }\r
-               protected void onLeaveHandler()\r
-               {\r
-                       synchronized(this._sync_object){\r
-                               current_code=-1;\r
-                               this.transmat=null;\r
-                       }\r
-                       return;                 \r
-               }\r
-\r
-               protected void onUpdateHandler(NyARSquare i_square, NyARTransMatResult result)\r
-               {\r
-                       synchronized(this._sync_object){\r
-                               this.transmat=result;\r
-                       }                       \r
-               }\r
-       }\r
-       private final static String CARCODE_FILE = "../Data/patt.hiro";\r
-       private final static String PARAM_FILE = "../Data/camera_para.dat";     \r
-       private final String data_file = "../Data/320x240ABGR.raw";\r
-\r
-       public SingleARMarkerTest()\r
-    {\r
-    }\r
-    public void Test() throws Exception\r
-    {\r
-        //AR用カメラパラメタファイルをロード\r
-        NyARParam ap = new NyARParam();\r
-        ap.loadARParamFromFile(PARAM_FILE);\r
-        ap.changeScreenSize(320, 240);\r
-\r
-               // 試験イメージの読み出し(320x240 BGRAのRAWデータ)\r
-               File f = new File(data_file);\r
-               FileInputStream fs = new FileInputStream(data_file);\r
-               byte[] buf = new byte[(int) f.length()];\r
-               fs.read(buf);           \r
-\r
-        NyARRgbRaster_BGRA ra = new NyARRgbRaster_BGRA(320, 240,false);\r
-        ra.wrapBuffer(buf);\r
-\r
-        MarkerProcessor pr = new MarkerProcessor(ap, ra.getBufferType());\r
-        NyARCode[] codes=new NyARCode[1];\r
-        codes[0]=new NyARCode(16,16);\r
-        codes[0].loadARPattFromFile(CARCODE_FILE);\r
-        pr.setARCodeTable(codes,16,80.0);\r
-        pr.detectMarker(ra);\r
-        return;\r
-    }\r
-       public static void main(String[] args)\r
-       {\r
-\r
-               try {\r
-                       SingleARMarkerTest t = new SingleARMarkerTest();\r
-                       // t.Test_arGetVersion();\r
-                       t.Test();\r
-               } catch (Exception e) {\r
-                       e.printStackTrace();\r
-               }\r
-       }    \r
-}\r