OSDN Git Service

[更新]NyARToolkit/nyatlaブランチ
authornyatla <nyatla@7cac0a50-4618-4814-88d0-24b83990f816>
Sat, 13 Sep 2008 15:35:20 +0000 (15:35 +0000)
committernyatla <nyatla@7cac0a50-4618-4814-88d0-24b83990f816>
Sat, 13 Sep 2008 15:35:20 +0000 (15:35 +0000)
sample/jogl/jp/nyatla/nyartoolkit/jogl/sample/JavaSimpleLite.java
src/jp/nyatla/nyartoolkit/core/INyARSquareDetector.java [new file with mode: 0644]
test/jp/nyatla/nyartoolkit/dev/LabelingCamera.java
test/jp/nyatla/nyartoolkit/dev/LabelingTest.java

index f982cf2..90820f1 100644 (file)
@@ -40,9 +40,6 @@ import javax.media.opengl.GLCanvas;
 import com.sun.opengl.util.Animator;\r
 \r
 import jp.nyatla.nyartoolkit.core.NyARCode;\r
-import jp.nyatla.nyartoolkit.core.raster.NyARGlayscaleRaster;\r
-import jp.nyatla.nyartoolkit.core.rasteranalyzer.threshold.NyARRasterThresholdAnalyzer_SlidePTile;\r
-import jp.nyatla.nyartoolkit.core2.NyARRasterFilter_RgbAve;\r
 \r
 import jp.nyatla.nyartoolkit.jmf.utils.JmfCameraCapture;\r
 import jp.nyatla.nyartoolkit.jmf.utils.JmfCaptureListener;\r
@@ -199,7 +196,7 @@ public class JavaSimpleLite implements GLEventListener, JmfCaptureListener
                        //画像チェックしてマーカー探して、背景を書く\r
                        boolean is_marker_exist;\r
                        synchronized (_cap_image) {\r
-                               is_marker_exist = _nya.detectMarkerLite(_cap_image, threshold);\r
+                               is_marker_exist = _nya.detectMarkerLite(_cap_image, 110);\r
                                //背景を書く\r
                                _glnya.drawBackGround(_cap_image, 1.0);\r
                        }\r
@@ -223,19 +220,11 @@ public class JavaSimpleLite implements GLEventListener, JmfCaptureListener
                }\r
 \r
        }\r
-       int threshold;\r
-       final NyARRasterThresholdAnalyzer_SlidePTile th=new NyARRasterThresholdAnalyzer_SlidePTile(15);\r
-       final NyARGlayscaleRaster gs=new NyARGlayscaleRaster(320,240);\r
-       final NyARRasterFilter_RgbAve togs=new NyARRasterFilter_RgbAve();\r
        public void onUpdateBuffer(Buffer i_buffer)\r
        {\r
                try {\r
                        synchronized (_cap_image) {\r
                                _cap_image.setBuffer(i_buffer, true);\r
-                               //閾値計算(めんどくさいから一時的に自動調整にしとく。)\r
-                               togs.doFilter(_cap_image, gs);\r
-                               th.analyzeRaster(gs);\r
-                               threshold=110;//th.getThreshold();\r
                        }\r
                } catch (Exception e) {\r
                        e.printStackTrace();\r
diff --git a/src/jp/nyatla/nyartoolkit/core/INyARSquareDetector.java b/src/jp/nyatla/nyartoolkit/core/INyARSquareDetector.java
new file mode 100644 (file)
index 0000000..f46c128
--- /dev/null
@@ -0,0 +1,9 @@
+package jp.nyatla.nyartoolkit.core;\r
+\r
+import jp.nyatla.nyartoolkit.NyARException;\r
+import jp.nyatla.nyartoolkit.core.raster.NyARBinRaster;\r
+\r
+public interface INyARSquareDetector\r
+{\r
+       public void detectMarker(NyARBinRaster i_raster, NyARSquareStack o_square_stack) throws NyARException;\r
+}\r
index 0bf5e40..9221943 100644 (file)
@@ -21,12 +21,12 @@ import java.awt.*;
 import jp.nyatla.nyartoolkit.core.labeling.*;
 import jp.nyatla.nyartoolkit.core.labeling.types.*;
 import jp.nyatla.nyartoolkit.core.raster.*;
-import jp.nyatla.nyartoolkit.core.rasteranalyzer.*;
-import jp.nyatla.nyartoolkit.core.rasteranalyzer.threshold.*;
 import jp.nyatla.nyartoolkit.core.rasterfilter.*;
-import jp.nyatla.nyartoolkit.core.rasterfilter.gs2bin.*;
 import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs.*;
-import jp.nyatla.nyartoolkit.core2.NyARRasterFilter_RgbAve;
+import jp.nyatla.nyartoolkit.core2.rasteranalyzer.*;
+import jp.nyatla.nyartoolkit.core2.rasteranalyzer.threshold.*;
+import jp.nyatla.nyartoolkit.core2.rasterfilter.gs2bin.*;
+import jp.nyatla.nyartoolkit.core2.rasterfilter.rgb2gs.NyARRasterFilter_RgbAve;
 import jp.nyatla.utils.j2se.LabelingBufferdImage;
 
 public class LabelingCamera extends Frame implements JmfCaptureListener {
index b49acaf..3cf02eb 100644 (file)
@@ -6,9 +6,9 @@ import java.io.FileInputStream;
 \r
 import jp.nyatla.nyartoolkit.core.raster.*;\r
 import jp.nyatla.nyartoolkit.core.raster.rgb.NyARRgbRaster_BGRA;\r
-import jp.nyatla.nyartoolkit.core.rasteranalyzer.*;\r
 import jp.nyatla.nyartoolkit.core.labeling.*;\r
 import jp.nyatla.nyartoolkit.core.labeling.types.*;\r
+import jp.nyatla.nyartoolkit.core2.rasteranalyzer.*;\r
 import jp.nyatla.utils.j2se.*;\r
 \r
 public class LabelingTest extends Frame\r