OSDN Git Service

[リリース]NyARToolkit 0.6
[nyartoolkit-and/nyartoolkit-and.git] / src / jp / nyatla / nyartoolkit / core / NyARDetectSquare.java
index ca3ae4f..c53a678 100644 (file)
@@ -81,7 +81,6 @@ public class NyARDetectSquare{
            return;\r
        }\r
        detect.detectMarker(labeling,1.0);\r
-       NyARMarker[] marker=detect.getMarkerArray();\r
        int number_of_marker=detect.getMarkerNum();\r
 \r
 \r
@@ -90,13 +89,15 @@ public class NyARDetectSquare{
        for (int i = 0; i <number_of_marker; i++){\r
            double[][]  line    =new double[4][3];\r
            double[][]  vertex  =new double[4][2];\r
+           NyARMarker marker=detect.getMarker(i);\r
            \r
            //・・・線の検出??\r
-            if (!getLine(marker[i].x_coord, marker[i].y_coord,marker[i].coord_num, marker[i].vertex,line,vertex))\r
+            if (!getLine(marker.x_coord, marker.y_coord,marker.coord_num, marker.vertex,line,vertex))\r
             {\r
                continue;\r
             }\r
-            marker_info[j]=new NyARSquare(marker[i],line,vertex);\r
+            //markerは参照渡し。実体はdetect内のバッファを共有してるので注意\r
+            marker_info[j]=new NyARSquare(marker,line,vertex);\r
 \r
             \r
 //ここで計算するのは良くないと思うんだ       \r
@@ -152,8 +153,8 @@ public class NyARDetectSquare{
             double [][] in_array=input.getArray();\r
             for( j = 0; j < n; j++ ) {\r
                param.observ2Ideal(x_coord[st+j], y_coord[st+j],dv1,dv2);//arParamObserv2Ideal( dist_factor, x_coord[st+j], y_coord[st+j],&(input->m[j*2+0]), &(input->m[j*2+1]) );\r
-                in_array[j][0]=dv1.get();\r
-                in_array[j][1]=dv2.get();\r
+                in_array[j][0]=dv1.value;\r
+                in_array[j][1]=dv2.value;\r
             }\r
             NyARMat.matrixPCA(input, evec, ev, mean);\r
             \r