OSDN Git Service

[update]NyARToolKit
authornyatla <nyatla@7cac0a50-4618-4814-88d0-24b83990f816>
Sat, 24 Apr 2010 02:43:14 +0000 (02:43 +0000)
committernyatla <nyatla@7cac0a50-4618-4814-88d0-24b83990f816>
Sat, 24 Apr 2010 02:43:14 +0000 (02:43 +0000)
+GLNyARRaster_RGBの廃止と、NyARGLUtilへの統合
+関連するサンプルの修正

git-svn-id: http://svn.sourceforge.jp/svnroot/nyartoolkit/NyARToolkit@438 7cac0a50-4618-4814-88d0-24b83990f816

12 files changed:
trunk/sample/jmf/jp/nyatla/nyartoolkit/jmf/sample/LabelingViewer.java
trunk/sample/jogl/jp/nyatla/nyartoolkit/jogl/sample/JavaSimpleLite.java
trunk/sample/jogl/jp/nyatla/nyartoolkit/jogl/sample/JavaSimpleLite2.java
trunk/sample/jogl/jp/nyatla/nyartoolkit/jogl/sample/SingleARMarker.java
trunk/sample/jogl/jp/nyatla/nyartoolkit/jogl/sample/SingleNyIdMarker.java
trunk/sample/sandbox/jp/nyatla/nyartoolkit/utils/j2se/NyARRGBRaster_BufferedImage.java
trunk/src.utils/jmf/jp/nyatla/nyartoolkit/jmf/utils/JmfNyARRaster_RGB.java
trunk/src.utils/jogl/jp/nyatla/nyartoolkit/jogl/utils/GLNyARRaster_RGB.java [deleted file]
trunk/src.utils/jogl/jp/nyatla/nyartoolkit/jogl/utils/NyARGLUtil.java
trunk/src.utils/qt/jp/nyatla/nyartoolkit/qt/utils/QtNyARRaster_RGB.java
trunk/test/jp/nyatla/nyartoolkit/dev/tracking/MarkerTracking_3dTrans.java
trunk/test/jp/nyatla/nyartoolkit/dev/tracking/TrTest.java

index b53c37d..15a3b4d 100644 (file)
@@ -85,7 +85,7 @@ public class LabelingViewer extends Frame implements JmfCaptureListener
                ar_param.loadARParamFromFile(PARAM_FILE);
                ar_param.changeScreenSize(320, 240);
                this._raster = new JmfNyARRaster_RGB(320, 240,this._capture.getCaptureFormat());
-               this._detect=new NyARSquareContourDetector_Rle(ar_param.getDistortionFactor(),ar_param.getScreenSize());
+               this._detect=new NyARSquareContourDetector_Rle(ar_param.getScreenSize());
                this._filter    = new NyARRasterFilter_ARToolkitThreshold(110, _raster.getBufferType());
                //キャプチャイメージ用のラスタを準備
                return;
index 60a2363..85f5323 100644 (file)
@@ -51,7 +51,7 @@ public class JavaSimpleLite implements GLEventListener, JmfCaptureListener
 \r
        private Animator _animator;\r
 \r
-       private GLNyARRaster_RGB _cap_image;\r
+       private JmfNyARRaster_RGB _cap_image;\r
 \r
        private JmfCaptureDevice _capture;\r
 \r
@@ -125,8 +125,8 @@ public class JavaSimpleLite implements GLEventListener, JmfCaptureListener
                        throw new NyARException();\r
                }\r
                this._capture.setOnCapture(this);\r
-               // GL対応のRGBラスタオブジェクト\r
-               this._cap_image = new GLNyARRaster_RGB(this._ar_param, this._capture.getCaptureFormat());\r
+               //JMFラスタオブジェクト\r
+               this._cap_image = new JmfNyARRaster_RGB(this._ar_param, this._capture.getCaptureFormat());\r
                \r
                // NyARToolkitの準備\r
                this._nya = new NyARSingleDetectMarker(this._ar_param, i_ar_code, 80.0,this._cap_image.getBufferType());\r
@@ -196,9 +196,9 @@ public class JavaSimpleLite implements GLEventListener, JmfCaptureListener
                }\r
                // 背景を書く\r
                this._gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // Clear the buffers for new frame.\r
-               this._glnya.drawBackGround(this._cap_image, 1.0);                       \r
                try{\r
                        synchronized(this._sync_object){\r
+                               this._glnya.drawBackGround(this._cap_image, 1.0);                       \r
                                // マーカーがあれば、立方体を描画\r
                                if (this._is_marker_exist){\r
                                        // マーカーの一致度を調査するならば、ここでnya.getConfidence()で一致度を調べて下さい。\r
index 4651f7d..732b9ca 100644 (file)
@@ -57,7 +57,7 @@ public class JavaSimpleLite2 implements GLEventListener, JmfCaptureListener
 \r
        private Animator _animator;\r
 \r
-       private GLNyARRaster_RGB _cap_image;\r
+       private JmfNyARRaster_RGB _cap_image;\r
 \r
        private JmfCaptureDevice _capture;\r
 \r
@@ -158,8 +158,8 @@ public class JavaSimpleLite2 implements GLEventListener, JmfCaptureListener
                        ar_codes[0].loadARPattFromFile(CARCODE_FILE1);\r
                        ar_codes[1] = new NyARCode(16, 16);\r
                        ar_codes[1].loadARPattFromFile(CARCODE_FILE2);\r
-                       //GL対応のRGBラスタオブジェクト\r
-                       this._cap_image = new GLNyARRaster_RGB(this._ar_param,_capture.getCaptureFormat());\r
+                       //JMFラスタオブジェクト\r
+                       this._cap_image = new JmfNyARRaster_RGB(this._ar_param,_capture.getCaptureFormat());\r
 \r
                        this._nya = new NyARDetectMarker(this._ar_param, ar_codes, width, 2,this._cap_image.getBufferType());\r
                        this._nya.setContinueMode(false);//ここをtrueにすると、transMatContinueモード(History計算)になります。\r
index 3ec35be..4899571 100644 (file)
@@ -118,7 +118,7 @@ public class SingleARMarker implements GLEventListener, JmfCaptureListener
        \r
        \r
        private Animator _animator;\r
-       private GLNyARRaster_RGB _cap_image;\r
+       private JmfNyARRaster_RGB _cap_image;\r
        private JmfCaptureDevice _capture;\r
 \r
        private GL _gl;\r
@@ -146,7 +146,7 @@ public class SingleARMarker implements GLEventListener, JmfCaptureListener
                        throw new NyARException();\r
                }\r
                this._capture.setOnCapture(this);\r
-               this._cap_image = new GLNyARRaster_RGB(i_cparam,this._capture.getCaptureFormat());      \r
+               this._cap_image = new JmfNyARRaster_RGB(i_cparam,this._capture.getCaptureFormat());     \r
 \r
                this._code_table[0]=new NyARCode(16,16);\r
                this._code_table[0].loadARPattFromFile(CARCODE_FILE1);\r
@@ -222,14 +222,14 @@ public class SingleARMarker implements GLEventListener, JmfCaptureListener
                }\r
                // 背景を書く\r
                this._gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // Clear the buffers for new frame.\r
-               this._glnya.drawBackGround(this._cap_image, 1.0);\r
                //OnEnter,OnUpdateの間に、transmatに初回行列がストアされる実行されることを防ぎます。\r
-               synchronized(this._sync_object)\r
-               {\r
-                       if(this._processor.current_code<0){\r
-                               \r
-                       }else{\r
-                               try{\r
+               try{\r
+                       this._glnya.drawBackGround(this._cap_image, 1.0);\r
+                       synchronized(this._sync_object)\r
+                       {\r
+                               if(this._processor.current_code<0){\r
+                                       \r
+                               }else{\r
                                        // Projection transformation.\r
                                        this._gl.glMatrixMode(GL.GL_PROJECTION);\r
                                        this._gl.glLoadMatrixd(_camera_projection, 0);\r
@@ -252,10 +252,10 @@ public class SingleARMarker implements GLEventListener, JmfCaptureListener
                                        this._panel.draw("MarkerId:"+this._processor.current_code,0.01f);\r
                                        this._gl.glPopMatrix();\r
                                        Thread.sleep(1);// タスク実行権限を一旦渡す\r
-                               }catch(Exception e){\r
-                                       e.printStackTrace();\r
                                }\r
                        }\r
+               }catch(Exception e){\r
+                       e.printStackTrace();\r
                }\r
                return;\r
 \r
index 142cbca..c66a79b 100644 (file)
@@ -80,7 +80,7 @@ class MarkerProcessor extends SingleNyIdMarkerProcesser
        {\r
                //アプリケーションフレームワークの初期化\r
                super();\r
-               initInstance(i_cparam,new NyIdMarkerDataEncoder_RawBit(),100,i_raster_format);\r
+               initInstance(i_cparam,new NyIdMarkerDataEncoder_RawBit(),100.0,i_raster_format);\r
                this._glnya=i_glutil;\r
                return;\r
        }\r
@@ -127,7 +127,7 @@ class MarkerProcessor extends SingleNyIdMarkerProcesser
 public class SingleNyIdMarker implements GLEventListener, JmfCaptureListener\r
 {\r
        private Animator _animator;\r
-       private GLNyARRaster_RGB _cap_image;\r
+       private JmfNyARRaster_RGB _cap_image;\r
        private JmfCaptureDevice _capture;\r
 \r
        private GL _gl;\r
@@ -154,7 +154,7 @@ public class SingleNyIdMarker implements GLEventListener, JmfCaptureListener
                        throw new NyARException();\r
                }\r
                this._capture.setOnCapture(this);\r
-               this._cap_image = new GLNyARRaster_RGB(i_cparam,this._capture.getCaptureFormat());      \r
+               this._cap_image = new JmfNyARRaster_RGB(i_cparam,this._capture.getCaptureFormat());     \r
                \r
                //OpenGLフレームの準備(OpenGLリソースの初期化、カメラの撮影開始は、initコールバック関数内で実行)\r
                Frame frame = new Frame("Java simpleLite with NyARToolkit");\r
@@ -224,13 +224,13 @@ public class SingleNyIdMarker implements GLEventListener, JmfCaptureListener
                }\r
                // 背景を書く\r
                this._gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // Clear the buffers for new frame.\r
-               this._glnya.drawBackGround(this._cap_image, 1.0);                       \r
-               synchronized(this._sync_object)\r
-               {\r
-                       if(this._processor.current_id<0){\r
-                               \r
-                       }else{\r
-                               try{\r
+               try{\r
+                       this._glnya.drawBackGround(this._cap_image, 1.0);                       \r
+                       synchronized(this._sync_object)\r
+                       {\r
+                               if(this._processor.current_id<0){\r
+                                       \r
+                               }else{\r
                                        // Projection transformation.\r
                                        this._gl.glMatrixMode(GL.GL_PROJECTION);\r
                                        this._gl.glLoadMatrixd(_camera_projection, 0);\r
@@ -254,11 +254,11 @@ public class SingleNyIdMarker implements GLEventListener, JmfCaptureListener
                                        this._panel.draw("MarkerId:"+this._processor.current_id,0.01f);\r
                                        this._gl.glPopMatrix();\r
                                        Thread.sleep(1);// タスク実行権限を一旦渡す\r
-                               }catch(Exception e){\r
-                                       e.printStackTrace();\r
                                }\r
-                       }\r
-               }               \r
+                       }               \r
+               }catch(Exception e){\r
+                       e.printStackTrace();\r
+               }\r
                return;\r
 \r
        }\r
index 537f668..6f61068 100644 (file)
@@ -46,14 +46,14 @@ public class NyARRGBRaster_BufferedImage extends NyARRgbRaster_BasicClass
        protected boolean _is_attached_buffer;\r
        public NyARRGBRaster_BufferedImage(int i_width, int i_height,boolean i_is_alloc) throws NyARException\r
        {\r
-               super( new NyARIntSize(i_width,i_height),NyARBufferType.OBJECT_Java_BufferedImage);\r
+               super(i_width,i_height,NyARBufferType.OBJECT_Java_BufferedImage);\r
                if(!initInstance(this._size,i_is_alloc)){\r
                        throw new NyARException();\r
                }\r
        }\r
        public NyARRGBRaster_BufferedImage(int i_width, int i_height) throws NyARException\r
        {\r
-               super( new NyARIntSize(i_width,i_height),NyARBufferType.OBJECT_Java_BufferedImage);\r
+               super(i_width,i_height,NyARBufferType.OBJECT_Java_BufferedImage);\r
                if(!initInstance(this._size,true)){\r
                        throw new NyARException();\r
                }\r
index 9c824d4..d1eddff 100644 (file)
@@ -34,9 +34,8 @@ import com.sun.media.codec.video.colorspace.*;
 import jp.nyatla.nyartoolkit.NyARException;\r
 import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
 import jp.nyatla.nyartoolkit.core.rasterreader.*;\r
-import jp.nyatla.nyartoolkit.core.raster.*;\r
 import jp.nyatla.nyartoolkit.core.types.*;\r
-\r
+import jp.nyatla.nyartoolkit.core.param.*;\r
 \r
 \r
 \r
@@ -52,6 +51,10 @@ public class JmfNyARRaster_RGB implements INyARRgbRaster
        private JmfRGB24RasterHolder _holder;\r
        protected NyARIntSize _size;\r
 \r
+       public JmfNyARRaster_RGB(NyARParam i_param,VideoFormat i_fmt) throws NyARException\r
+       {\r
+               initMember(i_param.getScreenSize().w,i_param.getScreenSize().h,i_fmt);\r
+       }       \r
        /**\r
         * i_fmtに一致する画素フォーマットのRasterを作成します。\r
         * このコンストラクタで作成したクラスは、hasBuffer()がfalseを返すことがあります。\r
diff --git a/trunk/src.utils/jogl/jp/nyatla/nyartoolkit/jogl/utils/GLNyARRaster_RGB.java b/trunk/src.utils/jogl/jp/nyatla/nyartoolkit/jogl/utils/GLNyARRaster_RGB.java
deleted file mode 100644 (file)
index c97d454..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* \r
- * PROJECT: NyARToolkit JOGL utilities.\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.jogl.utils;\r
-\r
-\r
-import javax.media.opengl.GL;\r
-\r
-import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.jmf.utils.*;\r
-import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
-import jp.nyatla.nyartoolkit.core.raster.*;\r
-import jp.nyatla.nyartoolkit.core.types.NyARBufferType;\r
-\r
-import javax.media.format.*;\r
-\r
-/**\r
- * NyARRaster_RGBにOpenGL用のデータ変換機能を追加したものです。\r
- */\r
-public class GLNyARRaster_RGB extends JmfNyARRaster_RGB\r
-{\r
-       private int _gl_flag;\r
-       /**\r
-        * コンストラクタです。i_formatを取り込めるi_paramのサイズパラメタを持つ\r
-        * ラスタオブジェクトを作成します。\r
-        * @param i_param\r
-        * カメラパラメタを指定します。コンストラクタは、画面サイズ以外のパラメタを見ていません。\r
-        * @param i_format\r
-        * キャプチャ画像のピクセルフォーマットを指定します。\r
-        * @throws NyARException\r
-        */\r
-       public GLNyARRaster_RGB(NyARParam i_param,VideoFormat i_format) throws NyARException\r
-       {\r
-               super(i_param.getScreenSize(),i_format);\r
-               initMember(this.getBufferType());\r
-               return;\r
-       }\r
-       public GLNyARRaster_RGB(int i_width,int i_height,VideoFormat i_format) throws NyARException\r
-       {\r
-               super(i_width,i_height,i_format);\r
-               initMember(this.getBufferType());\r
-               return;\r
-       }       \r
-       private void initMember(int i_buffer_type) throws NyARException\r
-       {\r
-               switch(i_buffer_type){\r
-               case NyARBufferType.BYTE1D_B8G8R8_24:\r
-                       this._gl_flag = GL.GL_BGR;\r
-                       break;\r
-               case NyARBufferType.BYTE1D_R8G8B8_24:\r
-                       this._gl_flag = GL.GL_RGB;\r
-                       break;\r
-               default:\r
-                       throw new NyARException();\r
-               }\r
-               return;\r
-       }\r
-       /**\r
-        * RGBバイト配列への参照値を返します。\r
-        * バッファの並び順は、getGLPixelFlagが返すデータ順で格納されています。\r
-        * @return\r
-        * RGBバイト配列の参照値です。\r
-        */\r
-       public byte[] getGLRgbArray()\r
-       {\r
-               return (byte[])this.getBuffer();\r
-       }\r
-\r
-       /**\r
-        * OpenGLの描画フラグを返します。\r
-        * この値は、RGBバッファのバイト並びタイプです。\r
-        * @return\r
-        * GL.GL_BGR等の、RGBバイト配列の形式を表す値です。\r
-        */\r
-       public int getGLPixelFlag()\r
-       {\r
-               return this._gl_flag;\r
-       }\r
-\r
-}\r
index ed5f733..899fb34 100644 (file)
@@ -35,7 +35,8 @@ import javax.media.opengl.GL;
 import javax.media.opengl.glu.GLU;\r
 \r
 import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.NyARMat;\r
+import jp.nyatla.nyartoolkit.core.*;\r
+import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
 import jp.nyatla.nyartoolkit.core.param.NyARParam;\r
 import jp.nyatla.nyartoolkit.core.transmat.NyARTransMatResult;\r
 import jp.nyatla.nyartoolkit.core.types.*;\r
@@ -53,13 +54,30 @@ public class NyARGLUtil
                this._gl = i_gl;\r
                this._glu = new GLU();\r
        }\r
-\r
+       /**\r
+        * ラスタのGLタイプを取得する。\r
+        * @param i_buffer_type\r
+        * @return\r
+        * @throws NyARException\r
+        */\r
+       final static private int getGlPixelFormat(int i_buffer_type) throws NyARException\r
+       {\r
+               switch(i_buffer_type){\r
+               case NyARBufferType.BYTE1D_B8G8R8_24:\r
+                       return GL.GL_BGR;\r
+               case NyARBufferType.BYTE1D_R8G8B8_24:\r
+                       return GL.GL_RGB;\r
+               default:\r
+                       throw new NyARException();\r
+               }\r
+       }\r
+       \r
        /**\r
         * GLNyARRaster_RGBをバックグラウンドに書き出す。\r
         * @param image\r
         * @param zoom\r
         */\r
-       public void drawBackGround(GLNyARRaster_RGB i_raster, double i_zoom)\r
+       public void drawBackGround(INyARRgbRaster i_raster, double i_zoom) throws NyARException\r
        {\r
                IntBuffer texEnvModeSave = IntBuffer.allocate(1);\r
                boolean lightingSave;\r
@@ -111,7 +129,7 @@ public class NyARGLUtil
         * @param image\r
         * @param zoom\r
         */\r
-       private void arglDispImageStateful(GLNyARRaster_RGB i_raster, double zoom)\r
+       private void arglDispImageStateful(INyARRgbRaster i_raster, double zoom) throws NyARException\r
        {\r
                javax.media.opengl.GL gl_ = this._gl;\r
                final NyARIntSize rsize = i_raster.getSize();\r
@@ -123,8 +141,8 @@ public class NyARGLUtil
                gl_.glPixelZoom(zoomf * ((float) (params.get(2)) / (float) rsize.w), -zoomf * ((float) (params.get(3)) / (float) rsize.h));\r
                gl_.glWindowPos2f(0.0f, (float) rsize.h);\r
                gl_.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);\r
-               ByteBuffer buf = ByteBuffer.wrap(i_raster.getGLRgbArray());\r
-               gl_.glDrawPixels(rsize.w,rsize.h, i_raster.getGLPixelFlag(), GL.GL_UNSIGNED_BYTE, buf);\r
+               ByteBuffer buf = ByteBuffer.wrap((byte[])i_raster.getBuffer());\r
+               gl_.glDrawPixels(rsize.w,rsize.h,getGlPixelFormat(i_raster.getBufferType()), GL.GL_UNSIGNED_BYTE, buf);\r
        }\r
        \r
        private double view_scale_factor = 0.025;\r
index ac20221..fc1bbb8 100644 (file)
@@ -26,7 +26,6 @@ package jp.nyatla.nyartoolkit.qt.utils;
 \r
 \r
 import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.*;\r
 import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
 import jp.nyatla.nyartoolkit.core.rasterreader.*;\r
 import jp.nyatla.nyartoolkit.core.types.*;\r
@@ -96,12 +95,4 @@ public class QtNyARRaster_RGB implements INyARRgbRaster
                this._buffer=(byte[])i_ref_buf;\r
                this._reader.switchBuffer(i_ref_buf);\r
        }\r
-       /**\r
-        *      @deprecated hasBuffer()関数を使ってください。\r
-        * \r
-        */\r
-       final public boolean hasData()\r
-       {\r
-               return this.hasBuffer();\r
-       }\r
 }\r
index bc29937..efa6310 100644 (file)
@@ -146,20 +146,29 @@ public class MarkerTracking_3dTrans
                                this.table_operator.updateMarker(item,sq);\r
                        }\r
                }\r
+               /**\r
+                * 基準頂点i_baseと新規矩形情報i_sqを比較して、i_sqの適切なdirection値を計算する。\r
+                * (運動量で計算したら?)\r
+                * @param i_base_vertex\r
+                * @param i_base_center\r
+                * @param i_sq\r
+                * @param i_sqcenter\r
+                * @return\r
+                */\r
                private int getNearVertexIndex(NyARDoublePoint2d i_base_vertex,NyARDoublePoint2d i_base_center,NyARIntPoint2d[] i_sq,NyARDoublePoint2d i_sqcenter)\r
                {\r
                        double bx,by;\r
                        //観察座標の中央位置からのベクトル\r
-                       bx=i_base_vertex.x-i_sqcenter.x;\r
-                       by=i_base_vertex.y-i_sqcenter.y;\r
+                       bx=i_base_vertex.x;\r
+                       by=i_base_vertex.y;\r
 \r
                        //一番近い頂点を探す.\r
-                       double d=NyARMath.sqNorm(bx,by,i_sq[3].x-i_sqcenter.x,i_sq[3].y-i_sqcenter.y);\r
+                       double d=NyARMath.sqNorm(bx,by,i_sq[3].x,i_sq[3].y);\r
                        int ret=3;\r
                        for(int i=2;i>=0;i--)\r
                        {\r
                                //予測座標の中央位置からのベクトルの長さを計算\r
-                               double d2=NyARMath.sqNorm(bx,by,i_sq[i].x-i_sqcenter.x,i_sq[i].y-i_sqcenter.y);\r
+                               double d2=NyARMath.sqNorm(bx,by,i_sq[i].x,i_sq[i].y);\r
                                if(d2<d){\r
                                        d=d2;\r
                                        ret=i;\r
index 2424f51..0cc3055 100644 (file)
@@ -20,8 +20,7 @@ import jp.nyatla.nyartoolkit.core.transmat.INyARTransMat;
 import jp.nyatla.nyartoolkit.core.transmat.NyARTransMat;\r
 import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureDevice;\r
 import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureDeviceList;\r
-import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureListener;\r
-import jp.nyatla.nyartoolkit.jogl.utils.GLNyARRaster_RGB;\r
+import jp.nyatla.nyartoolkit.jmf.utils.*;\r
 import jp.nyatla.nyartoolkit.utils.j2se.NyARRasterImageIO;\r
 import jp.nyatla.nyartoolkit.core.types.*;\r
 \r
@@ -37,7 +36,7 @@ class Tracking extends MarkerTracking_3dTrans
                super();\r
                initInstance(\r
                                new NyARColorPatt_Perspective_O2(i_code.getWidth(), i_code.getHeight(),4,25),\r
-                               new NyARSquareContourDetector_Rle(i_param.getDistortionFactor(),i_param.getScreenSize()),\r
+                               new NyARSquareContourDetector_Rle(i_param.getScreenSize()),\r
                                new NyARTransMat(i_param),\r
                                new NyARRasterFilter_ARToolkitThreshold(120,i_input_raster_type),\r
                                i_param,\r
@@ -58,7 +57,7 @@ public class TrTest extends Frame implements JmfCaptureListener,MouseMotionListe
 \r
        private JmfCaptureDevice _capture;\r
 \r
-       private GLNyARRaster_RGB _capraster;\r
+       private JmfNyARRaster_RGB _capraster;\r
 \r
        private int W = 320;\r
 \r
@@ -85,7 +84,7 @@ public class TrTest extends Frame implements JmfCaptureListener,MouseMotionListe
 \r
                NyARCode code = new NyARCode(16, 16);\r
                code.loadARPattFromFile(CARCODE_FILE);\r
-               this._capraster = new GLNyARRaster_RGB(ar_param, this._capture.getCaptureFormat());\r
+               this._capraster = new JmfNyARRaster_RGB(ar_param, this._capture.getCaptureFormat());\r
                this._capture.setOnCapture(this);\r
 \r
                addMouseMotionListener(this);\r
@@ -109,7 +108,7 @@ public class TrTest extends Frame implements JmfCaptureListener,MouseMotionListe
 \r
        \r
 \r
-       public void draw(GLNyARRaster_RGB i_raster)\r
+       public void draw(JmfNyARRaster_RGB i_raster)\r
        {\r
                try {\r
                        Insets ins = this.getInsets();\r