OSDN Git Service

git-svn-id: http://svn.sourceforge.jp/svnroot/nyartoolkit/NyARToolkit/trunk@719 7cac0...
authornyatla <nyatla@7cac0a50-4618-4814-88d0-24b83990f816>
Wed, 1 Dec 2010 02:39:56 +0000 (02:39 +0000)
committerAtsuo Igarashi <atsuoigarashi@ubuntu.(none)>
Tue, 5 Apr 2011 08:23:47 +0000 (17:23 +0900)
12 files changed:
Data/320x240ABGR.png [new file with mode: 0644]
lib/src.rpf/jp/nyatla/nyartoolkit/rpf/reality/nyartk/NyARRealityTarget.java
lib/src/jp/nyatla/nyartoolkit/nyidmarker/NyIdMarkerPickup.java
lib/test/jp/nyatla/nyartoolkit/test/NyIdTest.java
lib/test/jp/nyatla/nyartoolkit/test/SingleARMarkerTest.java
sample/java3d/src/jp/nyatla/nyartoolkit/java3d/sample/NyARJava3D.java
sample/jogl/src.rpf/jp/nyatla/nyartoolkit/rpf/sample/Test_NyARRealityGl_ARMarker.java
sample/jogl/src.rpf/jp/nyatla/nyartoolkit/rpf/sample/Test_NyARRealityGl_AsyncIdMarker.java
sample/jogl/src.rpf/jp/nyatla/nyartoolkit/rpf/sample/Test_NyARRealityGl_CreditCardDetect.java
sample/jogl/src.rpf/jp/nyatla/nyartoolkit/rpf/sample/Test_NyARRealityGl_IdMarker.java
sample/jogl/src.rpf/jp/nyatla/nyartoolkit/rpf/sample/Test_NyARRealityGl_ScreenPos.java
sample/sandbox/test/jp/nyatla/nyartoolkit/rpf/test/Test_RealityTarget.java

diff --git a/Data/320x240ABGR.png b/Data/320x240ABGR.png
new file mode 100644 (file)
index 0000000..1afc176
Binary files /dev/null and b/Data/320x240ABGR.png differ
index 1921951..d56f935 100644 (file)
@@ -283,10 +283,10 @@ public class NyARRealityTarget extends NyARManagedObject
                assert(this._target_type==RT_KNOWN);\r
                //RECT座標を作成\r
                NyARDoublePoint3d[] da4=this._ref_pool._wk_da3_4;\r
-               da4[0].x=i_x;    da4[0].y=i_y;    da4[0].z=0;\r
-               da4[1].x=i_x+i_w;da4[1].y=i_y;    da4[1].z=0;\r
-               da4[2].x=i_x+i_w;da4[2].y=i_y+i_h;da4[2].z=0;\r
-               da4[3].x=i_x;    da4[3].y=i_y+i_h;da4[3].z=0;\r
+               da4[0].x=i_x;    da4[0].y=i_y+i_h;da4[0].z=0;//LB\r
+               da4[1].x=i_x+i_w;da4[1].y=i_y+i_h;da4[1].z=0;//RB\r
+               da4[2].x=i_x+i_w;da4[2].y=i_y;    da4[2].z=0;//RT\r
+               da4[3].x=i_x;    da4[3].y=i_y;    da4[3].z=0;//LT\r
                return getRgbPatt3d(i_src,da4,null,i_resolution,o_raster);\r
        }\r
        \r
index 5a3b96e..919a074 100644 (file)
@@ -214,7 +214,6 @@ final class PerspectivePixelReader
                final int freq_table[]=this._freq_table;\r
                //初期化\r
                final double[] cpara=this._cparam;\r
-//             final INyARRgbPixelReader reader=this._raster.getRgbPixelReader();\r
                final int[] ref_x=this._ref_x;\r
                final int[] ref_y=this._ref_y;\r
                final int[] pixcel_temp=this._pixcel_temp;\r
@@ -655,6 +654,9 @@ final class PerspectivePixelReader
        \r
        public boolean readDataBits(INyARRgbPixelReader i_reader,NyARIntSize i_raster_size,PerspectivePixelReader.TThreshold i_th,MarkerPattEncoder o_bitbuffer)throws NyARException\r
        {\r
+               final int raster_width=i_raster_size.w;\r
+               final int raster_height=i_raster_size.h;\r
+               \r
                final double[] index_x=this.__readDataBits_index_bit_x;\r
                final double[] index_y=this.__readDataBits_index_bit_y;\r
                \r
@@ -695,8 +697,8 @@ final class PerspectivePixelReader
                        \r
                        int pt=0;\r
                        for(int i2=0;i2<resolution;i2++)\r
-                       {                       \r
-\r
+                       {\r
+                               int xx,yy;\r
                                double d;\r
                                double cx0=1+index_x[i2*2+0];\r
                                double cx1=1+index_x[i2*2+1];\r
@@ -710,26 +712,45 @@ final class PerspectivePixelReader
                                double cpx3_1=cpara_3*cx1;\r
                                \r
                                d=cp6_0+cpy0_7;\r
-                               ref_x[pt]=(int)((cpx0_0+cpy0_12)/d);\r
-                               ref_y[pt]=(int)((cpx3_0+cpy0_45)/d);\r
+                               ref_x[pt]=xx=(int)((cpx0_0+cpy0_12)/d);\r
+                               ref_y[pt]=yy=(int)((cpx3_0+cpy0_45)/d);\r
+                               if(xx<0 || xx>=raster_width || yy<0 || yy>=raster_height)\r
+                               {\r
+                                       ref_x[pt]=xx<0?0:(xx>=raster_width?raster_width-1:raster_width);\r
+                                       ref_y[pt]=yy<0?0:(yy>=raster_height?raster_height-1:raster_height);\r
+                               }\r
                                pt++;\r
 \r
                                d=cp6_0+cpy1_7;\r
-                               ref_x[pt]=(int)((cpx0_0+cpy1_12)/d);\r
-                               ref_y[pt]=(int)((cpx3_0+cpy1_45)/d);\r
+                               ref_x[pt]=xx=(int)((cpx0_0+cpy1_12)/d);\r
+                               ref_y[pt]=yy=(int)((cpx3_0+cpy1_45)/d);\r
+                               if(xx<0 || xx>=raster_width || yy<0 || yy>=raster_height)\r
+                               {\r
+                                       ref_x[pt]=xx<0?0:(xx>=raster_width?raster_width-1:raster_width);\r
+                                       ref_y[pt]=yy<0?0:(yy>=raster_height?raster_height-1:raster_height);\r
+                               }\r
                                pt++;\r
 \r
                                d=cp6_1+cpy0_7;\r
-                               ref_x[pt]=(int)((cpx0_1+cpy0_12)/d);\r
-                               ref_y[pt]=(int)((cpx3_1+cpy0_45)/d);\r
+                               ref_x[pt]=xx=(int)((cpx0_1+cpy0_12)/d);\r
+                               ref_y[pt]=yy=(int)((cpx3_1+cpy0_45)/d);\r
+                               if(xx<0 || xx>=raster_width || yy<0 || yy>=raster_height)\r
+                               {\r
+                                       ref_x[pt]=xx<0?0:(xx>=raster_width?raster_width-1:raster_width);\r
+                                       ref_y[pt]=yy<0?0:(yy>=raster_height?raster_height-1:raster_height);\r
+                               }\r
                                pt++;\r
 \r
                                d=cp6_1+cpy1_7;\r
-                               ref_x[pt]=(int)((cpx0_1+cpy1_12)/d);\r
-                               ref_y[pt]=(int)((cpx3_1+cpy1_45)/d);\r
+                               ref_x[pt]=xx=(int)((cpx0_1+cpy1_12)/d);\r
+                               ref_y[pt]=yy=(int)((cpx3_1+cpy1_45)/d);\r
+                               if(xx<0 || xx>=raster_width || yy<0 || yy>=raster_height)\r
+                               {\r
+                                       ref_x[pt]=xx<0?0:(xx>=raster_width?raster_width-1:raster_width);\r
+                                       ref_y[pt]=yy<0?0:(yy>=raster_height?raster_height-1:raster_height);\r
+                               }\r
                                pt++;\r
                        }\r
-                       //ここ、値チェックしてないけど? →周波数出すときに周辺部でエラー出したら落ちるようにしてるから平気では?エラーはいたら教えて。\r
                        //1行分のピクセルを取得(場合によっては専用アクセサを書いた方がいい)\r
                        i_reader.getPixelSet(ref_x,ref_y,resolution*4,pixcel_temp);\r
                        //グレースケールにしながら、line→mapへの転写\r
@@ -744,19 +765,7 @@ final class PerspectivePixelReader
                                p++;\r
                        }\r
                }\r
-/*             \r
-               for(int i=0;i<225*4;i++){\r
-                       this.vertex_x[i]=0;\r
-                       this.vertex_y[i]=0;\r
-               }\r
-               for(int i=0;i<(resolution)*2;i++){\r
-                       for(int i2=0;i2<(resolution)*2;i2++){\r
-                               this.vertex_x[i*(resolution)*2+i2]=(int)index_x[i2];\r
-                               this.vertex_y[i*(resolution)*2+i2]=(int)index_y[i];\r
-                               \r
-                       }\r
-               }\r
-*/             return true;\r
+               return true;\r
        }\r
        public boolean setSquare(NyARIntPoint2d[] i_vertex) throws NyARException\r
        {\r
index 1488829..32530bd 100644 (file)
@@ -81,6 +81,7 @@ public class NyIdTest
                     {\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
index 957efa4..fdd4fa7 100644 (file)
@@ -61,6 +61,7 @@ public class SingleARMarkerTest
                        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
index 9abde51..a13c08f 100644 (file)
@@ -41,8 +41,9 @@ import com.sun.j3d.utils.geometry.ColorCube;
 \r
 /**\r
  * Java3Dサンプルプログラム\r
- * 単一マーカー追跡用のBehaviorを使って、背景と1個のマーカーに連動した\r
- * TransformGroupを動かします。\r
+ * Hiroマーカ1個の上に、カラーキューブを表示します。\r
+ * このサンプルでは、Java3dのTransformGroupをマーカの位置姿勢に合致させるBehaviorと、\r
+ * 背景のオブジェクト一つを使います。\r
  *\r
  */\r
 public class NyARJava3D extends JFrame implements NyARSingleMarkerBehaviorListener\r
index 4c78f8b..d5d00d6 100644 (file)
@@ -1,3 +1,29 @@
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
 package jp.nyatla.nyartoolkit.rpf.sample;\r
 \r
 import java.awt.Color;\r
@@ -55,7 +81,7 @@ public class Test_NyARRealityGl_ARMarker implements GLEventListener, JmfCaptureL
 \r
        public Test_NyARRealityGl_ARMarker(NyARParam i_param) throws NyARException\r
        {\r
-               Frame frame = new Frame("NyARReality on OpenGL");\r
+               Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
                \r
                // キャプチャの準備\r
                JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
@@ -66,8 +92,9 @@ public class Test_NyARRealityGl_ARMarker implements GLEventListener, JmfCaptureL
                this._capture.setOnCapture(this);\r
                //Realityの構築\r
                i_param.changeScreenSize(SCREEN_X, SCREEN_Y);   \r
-               //キャプチャ画像と互換性のあるRealitySourceを構築\r
-               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+               //キャプチャ画像と互換性のあるRealitySourceを構築(樽型歪みの少ないカメラの時は、distortionFactorをnullにすること。)\r
+//             this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
                //OpenGL互換のRealityを構築               \r
                this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,10);\r
                //マーカライブラリ(ARTKId)の構築\r
@@ -239,9 +266,9 @@ public class Test_NyARRealityGl_ARMarker implements GLEventListener, JmfCaptureL
        {\r
        }\r
        \r
-       private final static String PARAM_FILE = "../Data/camera_para.dat";\r
-       private final static String PATT_HIRO = "../Data/patt.hiro";\r
-       private final static String PATT_KANJI = "../Data/patt.kanji";\r
+       private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
+       private final static String PATT_HIRO = "../../Data/patt.hiro";\r
+       private final static String PATT_KANJI = "../../Data/patt.kanji";\r
 \r
        public static void main(String[] args)\r
        {\r
index 99e72d2..a7d6219 100644 (file)
@@ -1,3 +1,29 @@
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
 package jp.nyatla.nyartoolkit.rpf.sample;\r
 \r
 import java.awt.Color;\r
@@ -15,7 +41,6 @@ import jp.nyatla.nyartoolkit.core.param.NyARParam;
 import jp.nyatla.nyartoolkit.core.types.NyARIntPoint2d;\r
 import jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix44;\r
 import jp.nyatla.nyartoolkit.rpf.mklib.ASyncIdMarkerTable;\r
-import jp.nyatla.nyartoolkit.rpf.mklib.RawbitSerialIdTable;\r
 import jp.nyatla.nyartoolkit.rpf.mklib.ASyncIdMarkerTable.IResultListener;\r
 import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTarget;\r
 import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTargetList;\r
@@ -58,7 +83,7 @@ public class Test_NyARRealityGl_AsyncIdMarker implements GLEventListener, JmfCap
 \r
        public Test_NyARRealityGl_AsyncIdMarker(NyARParam i_param) throws NyARException\r
        {\r
-               Frame frame = new Frame("NyARReality on OpenGL");\r
+               Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
                \r
                // キャプチャの準備\r
                JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
@@ -70,7 +95,8 @@ public class Test_NyARRealityGl_AsyncIdMarker implements GLEventListener, JmfCap
                //Realityの構築\r
                i_param.changeScreenSize(SCREEN_X, SCREEN_Y);   \r
                //キャプチャ画像と互換性のあるRealitySourceを構築\r
-               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),1,100);\r
+//             this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
                //OpenGL互換のRealityを構築               \r
                this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,3);\r
                //非同期マーカライブラリ(NyId)の構築\r
@@ -247,7 +273,7 @@ public class Test_NyARRealityGl_AsyncIdMarker implements GLEventListener, JmfCap
        {\r
        }\r
        \r
-       private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+       private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
 \r
        public static void main(String[] args)\r
        {\r
index 5871072..7e63fbc 100644 (file)
@@ -1,3 +1,29 @@
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
 package jp.nyatla.nyartoolkit.rpf.sample;\r
 \r
 import java.awt.Color;\r
@@ -9,20 +35,13 @@ import java.awt.event.WindowEvent;
 \r
 import javax.media.Buffer;\r
 import javax.media.opengl.*;\r
-import javax.media.opengl.glu.GLU;\r
 \r
 import jp.nyatla.nyartoolkit.NyARException;\r
 import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
-import jp.nyatla.nyartoolkit.core.param.NyARPerspectiveProjectionMatrix;\r
-import jp.nyatla.nyartoolkit.core.transmat.NyARTransMatResult;\r
 import jp.nyatla.nyartoolkit.core.types.NyARDoublePoint2d;\r
 import jp.nyatla.nyartoolkit.core.types.NyARIntPoint2d;\r
-import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
 import jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix44;\r
-import jp.nyatla.nyartoolkit.detector.NyARSingleDetectMarker;\r
-import jp.nyatla.nyartoolkit.rpf.mklib.ARTKMarkerTable;\r
 import jp.nyatla.nyartoolkit.rpf.mklib.CardDetect;\r
-import jp.nyatla.nyartoolkit.rpf.mklib.RawbitSerialIdTable;\r
 import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTarget;\r
 import jp.nyatla.nyartoolkit.rpf.reality.nyartk.NyARRealityTargetList;\r
 import jp.nyatla.nyartoolkit.rpf.realitysource.nyartk.NyARRealitySource_Jmf;\r
@@ -30,7 +49,6 @@ import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureDevice;
 import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureDeviceList;\r
 import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureListener;\r
 import jp.nyatla.nyartoolkit.jogl.utils.NyARGLDrawUtil;\r
-import jp.nyatla.nyartoolkit.jogl.utils.NyARGLUtil;\r
 import jp.nyatla.nyartoolkit.rpf.reality.nyartk.gl.NyARRealityGl;\r
 \r
 import com.sun.opengl.util.Animator;\r
@@ -70,7 +88,7 @@ public class Test_NyARRealityGl_CreditCardDetect implements GLEventListener, Jmf
        public Test_NyARRealityGl_CreditCardDetect(NyARParam i_param) throws NyARException\r
        {\r
                clock=0;\r
-               Frame frame = new Frame("CreditCard sample on OpenGL");\r
+               Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
                \r
                // キャプチャの準備\r
                JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
@@ -82,7 +100,8 @@ public class Test_NyARRealityGl_CreditCardDetect implements GLEventListener, Jmf
                //Realityの構築\r
                i_param.changeScreenSize(SCREEN_X, SCREEN_Y);   \r
                //キャプチャ画像と互換性のあるRealitySourceを構築\r
-               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+//             this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
                //OpenGL互換のRealityを構築               \r
                this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,10);\r
                //マーカライブラリ(比率推定)の構築\r
@@ -308,7 +327,7 @@ public class Test_NyARRealityGl_CreditCardDetect implements GLEventListener, Jmf
        {\r
        }\r
        \r
-       private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+       private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
 \r
        public static void main(String[] args)\r
        {\r
index f980382..5aa82e7 100644 (file)
@@ -1,3 +1,29 @@
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
 package jp.nyatla.nyartoolkit.rpf.sample;\r
 \r
 import java.awt.Color;\r
@@ -52,7 +78,7 @@ public class Test_NyARRealityGl_IdMarker implements GLEventListener, JmfCaptureL
 \r
        public Test_NyARRealityGl_IdMarker(NyARParam i_param) throws NyARException\r
        {\r
-               Frame frame = new Frame("NyARReality on OpenGL");\r
+               Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
                \r
                // キャプチャの準備\r
                JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
@@ -64,7 +90,8 @@ public class Test_NyARRealityGl_IdMarker implements GLEventListener, JmfCaptureL
                //Realityの構築\r
                i_param.changeScreenSize(SCREEN_X, SCREEN_Y);   \r
                //キャプチャ画像と互換性のあるRealitySourceを構築\r
-               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),1,100);\r
+//             this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
                //OpenGL互換のRealityを構築               \r
                this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,10);\r
                //マーカライブラリ(NyId)の構築\r
@@ -229,7 +256,7 @@ public class Test_NyARRealityGl_IdMarker implements GLEventListener, JmfCaptureL
        {\r
        }\r
        \r
-       private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+       private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
 \r
        public static void main(String[] args)\r
        {\r
index c2a867e..6f0ccf2 100644 (file)
@@ -1,3 +1,29 @@
+/* \r
+ * PROJECT: NyARToolkit JOGL sample program.\r
+ * --------------------------------------------------------------------------------\r
+ * The MIT License\r
+ * Copyright (c) 2008-2011 nyatla\r
+ * airmail(at)ebony.plala.or.jp\r
+ * http://nyatla.jp/nyartoolkit/\r
+ * \r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ * \r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ * \r
+ */\r
 package jp.nyatla.nyartoolkit.rpf.sample;\r
 \r
 import java.awt.Frame;\r
@@ -83,7 +109,7 @@ public class Test_NyARRealityGl_ScreenPos implements GLEventListener, JmfCapture
        public void mouseReleased(MouseEvent e){}\r
        public Test_NyARRealityGl_ScreenPos(NyARParam i_param) throws NyARException\r
        {\r
-               Frame frame = new Frame("NyARReality on OpenGL");\r
+               Frame frame = new Frame("NyARToolkit+RPF["+this.getClass().getName()+"]");\r
                \r
                // キャプチャの準備\r
                JmfCaptureDeviceList devlist = new JmfCaptureDeviceList();\r
@@ -95,7 +121,8 @@ public class Test_NyARRealityGl_ScreenPos implements GLEventListener, JmfCapture
                //Realityの構築\r
                i_param.changeScreenSize(SCREEN_X, SCREEN_Y);   \r
                //キャプチャ画像と互換性のあるRealitySourceを構築\r
-               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+//             this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),i_param.getDistortionFactor(),2,100);\r
+               this._src=new NyARRealitySource_Jmf(this._capture.getCaptureFormat(),null,2,100);\r
                //OpenGL互換のRealityを構築\r
                this._reality=new NyARRealityGl(i_param.getPerspectiveProjectionMatrix(),i_param.getScreenSize(),10,10000,3,3);\r
                //マーカライブラリ(NyId)の構築\r
@@ -253,7 +280,7 @@ public class Test_NyARRealityGl_ScreenPos implements GLEventListener, JmfCapture
        {\r
        }\r
        \r
-       private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+       private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
 \r
        public static void main(String[] args)\r
        {\r
index 628e520..819dc36 100644 (file)
@@ -35,6 +35,9 @@ import jp.nyatla.nyartoolkit.utils.j2se.*;
 \r
 /**\r
  * NyARRealityのテストプログラム。動作保証なし。\r
+ * \r
+ * ターゲットプロパティの取得実験用のテストコードです。\r
+ * クリックしたマーカや、その平面周辺から、画像を取得するテストができます。\r
  *\r
  */\r
 \r
@@ -147,26 +150,26 @@ public class Test_RealityTarget extends Frame implements MouseListener
                                                                //3d(カメラ)\r
                                                                {\r
                                                                        NyARDoublePoint3d[] p=NyARDoublePoint3d.createArray(4);\r
-                                                                       p[3].x=-40;p[3].y=-40;p[3].z=0;\r
-                                                                       p[2].x=40; p[2].y=-40;p[2].z=0;\r
+                                                                       p[0].x=-60;p[0].y=40 ;p[0].z=0;\r
                                                                        p[1].x=40; p[1].y=40 ;p[1].z=0;\r
-                                                                       p[0].x=-40;p[0].y=40 ;p[0].z=0;\r
+                                                                       p[2].x=40; p[2].y=-40;p[2].z=0;\r
+                                                                       p[3].x=-60;p[3].y=-40;p[3].z=0;\r
                                                                        this._reality.getRgbPatt3d(this._input_source.reality_in,p, rt.refTransformMatrix(), 1, bmp);\r
                                                                        this.getGraphics().drawImage(bmp.getBufferedImage(),this.getInsets().left+100,this.getInsets().top+240,null);\r
                                                                }\r
                                                                //3d(Target)\r
                                                                {\r
                                                                        NyARDoublePoint3d[] p=NyARDoublePoint3d.createArray(4);\r
-                                                                       p[3].x=-40;p[3].y=-40;p[3].z=0;\r
-                                                                       p[2].x=40; p[2].y=-40;p[2].z=0;\r
+                                                                       p[0].x=-40;p[0].y=40 ;p[0].z=0;\r
                                                                        p[1].x=40; p[1].y=40 ;p[1].z=0;\r
-                                                                       p[0].x=-80;p[0].y=40 ;p[0].z=0;\r
+                                                                       p[2].x=40; p[2].y=-40;p[2].z=0;\r
+                                                                       p[3].x=-40;p[3].y=-40;p[3].z=0;\r
                                                                        rt.getRgbPatt3d(this._input_source.reality_in,p,null, 1, bmp);\r
                                                                        this.getGraphics().drawImage(bmp.getBufferedImage(),this.getInsets().left+200,this.getInsets().top+240,null);\r
                                                                }\r
                                                                //3d(Target)\r
                                                                {\r
-                                                                       rt.getRgbRectPatt3d(this._input_source.reality_in,-80,-80,80,80,1, bmp);\r
+                                                                       rt.getRgbRectPatt3d(this._input_source.reality_in,-40,-40,80,80,1, bmp);\r
                                                                        this.getGraphics().drawImage(bmp.getBufferedImage(),this.getInsets().left+300,this.getInsets().top+240,null);\r
                                                                }\r
                                                        break;\r
@@ -202,8 +205,8 @@ public class Test_RealityTarget extends Frame implements MouseListener
        \r
        NyARParam _param;\r
        \r
-       private final static String SAMPLE_FILES = "../Data/320x240ABGR.png";\r
-       private final static String PARAM_FILE = "../Data/camera_para.dat";\r
+       private final static String SAMPLE_FILES = "../../Data/320x240ABGR.png";\r
+       private final static String PARAM_FILE = "../../Data/camera_para.dat";\r
 \r
        private static final long serialVersionUID = -2110888320986446576L;\r
 \r
@@ -327,7 +330,7 @@ public class Test_RealityTarget extends Frame implements MouseListener
        g.drawString("[D]("+t.grab_rate+")",r.x,r.y);\r
     }\r
     \r
-       private final static String PATT_HIRO = "../Data/patt.hiro";\r
+       private final static String PATT_HIRO = "../../Data/patt.hiro";\r
     \r
 \r
 \r