OSDN Git Service

git-svn-id: http://svn.sourceforge.jp/svnroot/nyartoolkit/NyARToolkit@383 7cac0a50...
authornyatla <nyatla@7cac0a50-4618-4814-88d0-24b83990f816>
Wed, 13 Jan 2010 14:57:56 +0000 (14:57 +0000)
committernyatla <nyatla@7cac0a50-4618-4814-88d0-24b83990f816>
Wed, 13 Jan 2010 14:57:56 +0000 (14:57 +0000)
16 files changed:
trunk/sample/sandbox/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_PTile.java [moved from trunk/sample/sandbox/jp/nyatla/nyartoolkit/core/analyzer/histgram/NyARHistgramAnalyzer_PTile.java with 78% similarity]
trunk/sample/sandbox/jp/nyatla/nyartoolkit/core/rasteranalyzer/threshold/NyARRasterThresholdAnalyzer_DiffHistogram.java [moved from trunk/sample/sandbox/jp/nyatla/nyartoolkit/core/rasteranalyzer/threshold/NyARRasterThresholdAnalyzer_DiffHistgram.java with 77% similarity]
trunk/sample/sandbox/jp/nyatla/nyartoolkit/sandbox/qrcode/SingleQrTest.java
trunk/sample/sandbox/jp/nyatla/nyartoolkit/sandbox/x2/NyARSingleDetectMarker_X2.java
trunk/sample/sandbox/jp/nyatla/nyartoolkit/sandbox/x2/VisualTest.java
trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histgram/INyARHistgramAnalyzer_Threshold.java [deleted file]
trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/INyARHistogramAnalyzer_Threshold.java [new file with mode: 0644]
trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_DiscriminantThreshold.java [moved from trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histgram/NyARHistgramAnalyzer_DiscriminantThreshold.java with 74% similarity]
trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_KittlerThreshold.java [moved from trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histgram/NyARHistgramAnalyzer_KittlerThreshold.java with 71% similarity]
trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/NyARHistogramAnalyzer_SlidePTile.java [moved from trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histgram/NyARHistgramAnalyzer_SlidePTile.java with 62% similarity]
trunk/src/jp/nyatla/nyartoolkit/core/analyzer/raster/NyARRasterAnalyzer_Histogram.java [moved from trunk/src/jp/nyatla/nyartoolkit/core/analyzer/raster/NyARRasterAnalyzer_Histgram.java with 67% similarity]
trunk/src/jp/nyatla/nyartoolkit/core/analyzer/raster/threshold/NyARRasterThresholdAnalyzer_SlidePTile.java
trunk/src/jp/nyatla/nyartoolkit/core/rasterfilter/NyARRasterFilter_EqualizeHist.java
trunk/src/jp/nyatla/nyartoolkit/core/types/NyARHistogram.java [moved from trunk/src/jp/nyatla/nyartoolkit/core/types/NyARHistgram.java with 91% similarity]
trunk/src/jp/nyatla/nyartoolkit/utils/j2se/NyARRasterImageIO.java
trunk/test/jp/nyatla/nyartoolkit/dev/LabelingCamera.java

@@ -22,7 +22,7 @@
  *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
  * \r
  */\r
-package jp.nyatla.nyartoolkit.core.analyzer.histgram;\r
+package jp.nyatla.nyartoolkit.core.analyzer.histogram;\r
 \r
 \r
 import jp.nyatla.nyartoolkit.core.types.*;\r
@@ -32,25 +32,25 @@ import jp.nyatla.nyartoolkit.core.types.*;
  * Pタイル法による閾値検出\r
  * \r
  */\r
-public class NyARHistgramAnalyzer_PTile\r
+public class NyARHistogramAnalyzer_PTile\r
 {\r
        private int _persentage;\r
-       public NyARHistgramAnalyzer_PTile(int i_persentage)\r
+       public NyARHistogramAnalyzer_PTile(int i_persentage)\r
        {\r
                //初期化\r
                this._persentage=i_persentage;\r
        }       \r
-       public int getThreshold(NyARHistgram i_histgram)\r
+       public int getThreshold(NyARHistogram i_histogram)\r
        {\r
                // 閾値ピクセル数確定\r
-               int th_pixcels = i_histgram.total_of_data * this._persentage / 100;\r
+               int th_pixcels = i_histogram.total_of_data * this._persentage / 100;\r
 \r
                // 閾値判定\r
                int i;\r
                if (th_pixcels > 0) {\r
                        // 黒点基準\r
                        for (i = 0; i < 254; i++) {\r
-                               th_pixcels -= i_histgram.data[i];\r
+                               th_pixcels -= i_histogram.data[i];\r
                                if (th_pixcels <= 0) {\r
                                        break;\r
                                }\r
@@ -58,7 +58,7 @@ public class NyARHistgramAnalyzer_PTile
                } else {\r
                        // 白点基準\r
                        for (i = 255; i > 1; i--) {\r
-                               th_pixcels += i_histgram.data[i];\r
+                               th_pixcels += i_histogram.data[i];\r
                                if (th_pixcels >= 0) {\r
                                        break;\r
                                }\r
@@ -33,15 +33,15 @@ import jp.nyatla.nyartoolkit.core.types.*;
  * 微分ヒストグラム法による閾値検出\r
  * \r
  */\r
-public class NyARRasterThresholdAnalyzer_DiffHistgram implements INyARRasterThresholdAnalyzer\r
+public class NyARRasterThresholdAnalyzer_DiffHistogram implements INyARRasterThresholdAnalyzer\r
 {\r
        private int _threshold;\r
 \r
-       public NyARRasterThresholdAnalyzer_DiffHistgram()\r
+       public NyARRasterThresholdAnalyzer_DiffHistogram()\r
        {\r
        }\r
 \r
-       private int createHistgram(int[] in_buf,NyARIntSize i_size, int[] o_histgram) throws NyARException\r
+       private int createHistogram(int[] in_buf,NyARIntSize i_size, int[] o_histogram) throws NyARException\r
        {\r
                int[][] fil1={\r
                                {-1,-2,-1},\r
@@ -50,7 +50,7 @@ public class NyARRasterThresholdAnalyzer_DiffHistgram implements INyARRasterThre
 \r
                // ヒストグラムを作成\r
                for (int i = 0; i < 256; i++) {\r
-                       o_histgram[i] = 0;\r
+                       o_histogram[i] = 0;\r
                }\r
                int sam;\r
                int sam1,sam2;\r
@@ -66,15 +66,15 @@ public class NyARRasterThresholdAnalyzer_DiffHistgram implements INyARRasterThre
                                        }                                       \r
                                }\r
                                sam=sam1*sam1+sam2*sam2;\r
-                               o_histgram[v]+=sam;\r
+                               o_histogram[v]+=sam;\r
                        }\r
                }\r
                int th=0;\r
-               int max=o_histgram[0];\r
+               int max=o_histogram[0];\r
                for(int i=1;i<256;i++){\r
-                       if(max<o_histgram[i]){\r
+                       if(max<o_histogram[i]){\r
                                th=i;\r
-                               max=o_histgram[i];\r
+                               max=o_histogram[i];\r
                        }\r
                }\r
                return th;\r
@@ -83,8 +83,8 @@ public class NyARRasterThresholdAnalyzer_DiffHistgram implements INyARRasterThre
        public int analyzeRaster(INyARRaster i_input) throws NyARException\r
        {\r
                assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
-               int[] histgram = new int[256];\r
-               return createHistgram((int[])i_input.getBuffer(),i_input.getSize(), histgram);\r
+               int[] histogram = new int[256];\r
+               return createHistogram((int[])i_input.getBuffer(),i_input.getSize(), histogram);\r
        }\r
 \r
        /**\r
@@ -93,7 +93,7 @@ public class NyARRasterThresholdAnalyzer_DiffHistgram implements INyARRasterThre
         * @param i_output\r
         * 書き出し先のラスタオブジェクト 256ピクセル以上の幅があること。\r
         */\r
-       public void debugDrawHistgramMap(INyARRaster i_input, INyARRaster i_output) throws NyARException\r
+       public void debugDrawHistogramMap(INyARRaster i_input, INyARRaster i_output) throws NyARException\r
        {\r
                assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
                assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
@@ -107,14 +107,14 @@ public class NyARRasterThresholdAnalyzer_DiffHistgram implements INyARRasterThre
                        }\r
                }\r
                // ヒストグラムを計算\r
-               int[] histgram = new int[256];\r
-               int threshold = createHistgram((int[])i_input.getBuffer(),i_input.getSize(), histgram);\r
+               int[] histogram = new int[256];\r
+               int threshold = createHistogram((int[])i_input.getBuffer(),i_input.getSize(), histogram);\r
 \r
                // ヒストグラムの最大値を出す\r
                int max_v = 0;\r
                for (int i = 0; i < 255; i++) {\r
-                       if (max_v < histgram[i]) {\r
-                               max_v = histgram[i];\r
+                       if (max_v < histogram[i]) {\r
+                               max_v = histogram[i];\r
                        }\r
                }\r
                // 目盛り\r
@@ -125,7 +125,7 @@ public class NyARRasterThresholdAnalyzer_DiffHistgram implements INyARRasterThre
                }\r
                // スケーリングしながら描画\r
                for (int i = 0; i < 255; i++) {\r
-                       out_buf[(histgram[i] * (size.h - 1) / max_v)* size.w+i] = 255;\r
+                       out_buf[(histogram[i] * (size.h - 1) / max_v)* size.w+i] = 255;\r
                }\r
                // 値\r
                for (int i = 0; i < size.h; i++) {\r
index 672cba0..a0b09ba 100644 (file)
@@ -21,7 +21,7 @@ import jp.nyatla.nyartoolkit.core.labeling.artoolkit.NyARLabelingImage;
 import jp.nyatla.nyartoolkit.core.labeling.artoolkit.NyARLabeling_ARToolKit;
 import jp.nyatla.nyartoolkit.core.param.*;
 import jp.nyatla.nyartoolkit.core.raster.*;
-import jp.nyatla.nyartoolkit.core.rasteranalyzer.threshold.NyARRasterThresholdAnalyzer_DiffHistgram;
+import jp.nyatla.nyartoolkit.core.rasteranalyzer.threshold.NyARRasterThresholdAnalyzer_DiffHistogram;
 import jp.nyatla.nyartoolkit.core.rasterfilter.*;
 import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs.*;
 import jp.nyatla.nyartoolkit.core.rasterfilter.gs2bin.*;
@@ -62,7 +62,7 @@ public class SingleQrTest extends Frame implements JmfCaptureListener
        private NyARBinRaster _binraster1 = new NyARBinRaster(320, 240);
 
        private NyARGrayscaleRaster _gsraster1 = new NyARGrayscaleRaster(320, 240);
-       private INyARRasterThresholdAnalyzer _tha=new NyARRasterThresholdAnalyzer_DiffHistgram();
+       private INyARRasterThresholdAnalyzer _tha=new NyARRasterThresholdAnalyzer_DiffHistogram();
 
        private LabelingBufferdImage _bimg = new LabelingBufferdImage(320, 240);
 
@@ -125,7 +125,7 @@ public class SingleQrTest extends Frame implements JmfCaptureListener
                        this.getGraphics().drawImage(this._bimg, 32 + 320, 32 + 240, 320 + 32 + 320, 240 + 32 + 240, 0, 240, 320, 0, this);
 
                        // 画像3
-                       // threshold.debugDrawHistgramMap(_workraster, _workraster2);
+                       // threshold.debugDrawHistogramMap(_workraster, _workraster2);
                        // this._bimg2.setImage(this._workraster2);
                        // this.getGraphics().drawImage(this._bimg2, 32+320, 32+240,320+32+320,240+32+240,0,240,320,0, this);
 
@@ -145,7 +145,7 @@ public class SingleQrTest extends Frame implements JmfCaptureListener
                        // 画像5
 
                        /*
-                        * threshold2.debugDrawHistgramMap(_workraster, _workraster2); this._bimg2.drawImage(this._workraster2); this.getGraphics().drawImage(this._bimg2,
+                        * threshold2.debugDrawHistogramMap(_workraster, _workraster2); this._bimg2.drawImage(this._workraster2); this.getGraphics().drawImage(this._bimg2,
                         * 32+320, 32+480,320+32+320,480+32+240,0,240,320,0, this);
                         */
 
index 4e31eef..4531dbf 100644 (file)
@@ -41,7 +41,6 @@ import jp.nyatla.nyartoolkit.core.raster.*;
 import jp.nyatla.nyartoolkit.core.transmat.*;\r
 import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
 import jp.nyatla.nyartoolkit.core.rasterfilter.gs2bin.*;\r
-import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.NyARRasterFilterBuilder_RgbToBin;\r
 import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.NyARRasterFilter_ARToolkitThreshold;\r
 import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
 import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
index a14c3d0..daf0f1d 100644 (file)
@@ -24,7 +24,7 @@ import jp.nyatla.nyartoolkit.core.labeling.artoolkit.NyARLabelingImage;
 import jp.nyatla.nyartoolkit.core.labeling.artoolkit.NyARLabeling_ARToolKit;
 import jp.nyatla.nyartoolkit.core.param.*;
 import jp.nyatla.nyartoolkit.core.raster.*;
-import jp.nyatla.nyartoolkit.core.rasteranalyzer.threshold.NyARRasterThresholdAnalyzer_DiffHistgram;
+import jp.nyatla.nyartoolkit.core.rasteranalyzer.threshold.NyARRasterThresholdAnalyzer_DiffHistogram;
 import jp.nyatla.nyartoolkit.core.rasterfilter.*;
 import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs.INyARRasterFilter_Rgb2Gs;
 import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareStack;
@@ -65,7 +65,7 @@ public class VisualTest extends Frame implements JmfCaptureListener
        private NyARBinRaster _binraster1 = new NyARBinRaster(160,120);
 
        private NyARGrayscaleRaster _gsraster1 = new NyARGrayscaleRaster(320, 240);
-       private INyARRasterThresholdAnalyzer _tha=new NyARRasterThresholdAnalyzer_DiffHistgram();
+       private INyARRasterThresholdAnalyzer _tha=new NyARRasterThresholdAnalyzer_DiffHistogram();
 
        private LabelingBufferdImage _bimg = new LabelingBufferdImage(320, 240);
        private LabelingBufferdImage _bimg2 = new LabelingBufferdImage(160, 120);
diff --git a/trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histgram/INyARHistgramAnalyzer_Threshold.java b/trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histgram/INyARHistgramAnalyzer_Threshold.java
deleted file mode 100644 (file)
index 1e372d9..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package jp.nyatla.nyartoolkit.core.analyzer.histgram;\r
-\r
-import jp.nyatla.nyartoolkit.core.types.NyARHistgram;\r
-\r
-public interface INyARHistgramAnalyzer_Threshold\r
-{\r
-       /**\r
-        * ヒストグラムから閾値探索をします。\r
-        * @param i_histgram\r
-        * ヒストグラム\r
-        * @return\r
-        */\r
-       public int getThreshold(NyARHistgram i_histgram);\r
-}\r
diff --git a/trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/INyARHistogramAnalyzer_Threshold.java b/trunk/src/jp/nyatla/nyartoolkit/core/analyzer/histogram/INyARHistogramAnalyzer_Threshold.java
new file mode 100644 (file)
index 0000000..bd5771b
--- /dev/null
@@ -0,0 +1,14 @@
+package jp.nyatla.nyartoolkit.core.analyzer.histogram;\r
+\r
+import jp.nyatla.nyartoolkit.core.types.NyARHistogram;\r
+\r
+public interface INyARHistogramAnalyzer_Threshold\r
+{\r
+       /**\r
+        * ヒストグラムから閾値探索をします。\r
+        * @param i_histogram\r
+        * ヒストグラム\r
+        * @return\r
+        */\r
+       public int getThreshold(NyARHistogram i_histogram);\r
+}\r
@@ -1,23 +1,23 @@
-package jp.nyatla.nyartoolkit.core.analyzer.histgram;\r
+package jp.nyatla.nyartoolkit.core.analyzer.histogram;\r
 \r
-import jp.nyatla.nyartoolkit.core.types.NyARHistgram;\r
+import jp.nyatla.nyartoolkit.core.types.NyARHistogram;\r
 \r
 /**\r
  * 判別法で閾値を求めます。\r
  * 画素数が2048^2に満たない場合は、fixedint(24-8)で計算できます。\r
- * @param i_histgram\r
+ * @param i_histogram\r
  * @param o_value\r
  * @return\r
  */\r
-public class NyARHistgramAnalyzer_DiscriminantThreshold implements INyARHistgramAnalyzer_Threshold\r
+public class NyARHistogramAnalyzer_DiscriminantThreshold implements INyARHistogramAnalyzer_Threshold\r
 {\r
        private double _score;\r
 \r
 \r
-       public int getThreshold(NyARHistgram i_histgram)\r
+       public int getThreshold(NyARHistogram i_histogram)\r
        {\r
-               int[] hist=i_histgram.data;\r
-               int n=i_histgram.length;\r
+               int[] hist=i_histogram.data;\r
+               int n=i_histogram.length;\r
                int da,sa,db,sb,dt,pt,st;\r
                int i;          \r
                int th=0;\r
@@ -28,7 +28,7 @@ public class NyARHistgramAnalyzer_DiscriminantThreshold implements INyARHistgram
                        dt+=h*i;\r
                        pt+=h*i*i;//正規化の時に使う定数\r
                }\r
-               st=i_histgram.total_of_data;\r
+               st=i_histogram.total_of_data;\r
                //Low側(0<=i<=n-2)\r
                da=dt;\r
                sa=st;\r
@@ -78,12 +78,12 @@ public class NyARHistgramAnalyzer_DiscriminantThreshold implements INyARHistgram
         */\r
        public static void main(String[] args)\r
        {\r
-               NyARHistgram data=new NyARHistgram(256);\r
+               NyARHistogram data=new NyARHistogram(256);\r
                for(int i=0;i<256;i++){\r
                        data.data[i]=128-i>0?128-i:i-128;\r
                }\r
                data.total_of_data=data.getTotal(0,255);\r
-               NyARHistgramAnalyzer_DiscriminantThreshold an=new NyARHistgramAnalyzer_DiscriminantThreshold();\r
+               NyARHistogramAnalyzer_DiscriminantThreshold an=new NyARHistogramAnalyzer_DiscriminantThreshold();\r
                int th=an.getThreshold(data);\r
                System.out.print(th);\r
                return;\r
@@ -1,16 +1,16 @@
-package jp.nyatla.nyartoolkit.core.analyzer.histgram;\r
+package jp.nyatla.nyartoolkit.core.analyzer.histogram;\r
 \r
-import jp.nyatla.nyartoolkit.core.types.NyARHistgram;\r
+import jp.nyatla.nyartoolkit.core.types.NyARHistogram;\r
 \r
 \r
 /**\r
  * kittlerThresholdの方式で閾値を求めます。\r
- * @param i_histgram\r
+ * @param i_histogram\r
  * @return\r
  */\r
-public class NyARHistgramAnalyzer_KittlerThreshold implements INyARHistgramAnalyzer_Threshold\r
+public class NyARHistogramAnalyzer_KittlerThreshold implements INyARHistogramAnalyzer_Threshold\r
 {\r
-       public int getThreshold(NyARHistgram i_histgram)\r
+       public int getThreshold(NyARHistogram i_histogram)\r
        {\r
                int i;          \r
                double min=Double.MAX_VALUE;\r
@@ -18,8 +18,8 @@ public class NyARHistgramAnalyzer_KittlerThreshold implements INyARHistgramAnaly
                int da,sa,db,sb,pa,pb;\r
                double oa,ob;\r
                \r
-               int[] hist=i_histgram.data;\r
-               int n=i_histgram.length;\r
+               int[] hist=i_histogram.data;\r
+               int n=i_histogram.length;\r
                //Low側\r
                da=pa=0;\r
                int h;\r
@@ -28,7 +28,7 @@ public class NyARHistgramAnalyzer_KittlerThreshold implements INyARHistgramAnaly
                        da+=h*i;        //i*h[i]\r
                        pa+=h*i*i;      //i*i*h[i]\r
                }\r
-               sa=i_histgram.total_of_data;\r
+               sa=i_histogram.total_of_data;\r
                //High側(i=n-1)\r
                db=0;\r
                sb=0;\r
@@ -75,12 +75,12 @@ public class NyARHistgramAnalyzer_KittlerThreshold implements INyARHistgramAnaly
        }\r
        public static void main(String[] args)\r
        {\r
-               NyARHistgram data=new NyARHistgram(256);\r
+               NyARHistogram data=new NyARHistogram(256);\r
                for(int i=0;i<256;i++){\r
                        data.data[i]=128-i>0?128-i:i-128;\r
                }\r
                data.total_of_data=data.getTotal(0,255);\r
-               NyARHistgramAnalyzer_KittlerThreshold an=new NyARHistgramAnalyzer_KittlerThreshold();\r
+               NyARHistogramAnalyzer_KittlerThreshold an=new NyARHistogramAnalyzer_KittlerThreshold();\r
                int th=an.getThreshold(data);\r
                System.out.print(th);\r
                return;\r
@@ -1,6 +1,6 @@
-package jp.nyatla.nyartoolkit.core.analyzer.histgram;\r
+package jp.nyatla.nyartoolkit.core.analyzer.histogram;\r
 \r
-import jp.nyatla.nyartoolkit.core.types.NyARHistgram;\r
+import jp.nyatla.nyartoolkit.core.types.NyARHistogram;\r
 \r
 \r
 \r
@@ -9,21 +9,21 @@ import jp.nyatla.nyartoolkit.core.types.NyARHistgram;
  * \r
  * \r
  */\r
-public class NyARHistgramAnalyzer_SlidePTile implements INyARHistgramAnalyzer_Threshold\r
+public class NyARHistogramAnalyzer_SlidePTile implements INyARHistogramAnalyzer_Threshold\r
 {\r
        private int _persentage;\r
-       public NyARHistgramAnalyzer_SlidePTile(int i_persentage)\r
+       public NyARHistogramAnalyzer_SlidePTile(int i_persentage)\r
        {\r
                assert (0 <= i_persentage && i_persentage <= 50);\r
                //初期化\r
                this._persentage=i_persentage;\r
        }       \r
-       public int getThreshold(NyARHistgram i_histgram)\r
+       public int getThreshold(NyARHistogram i_histogram)\r
        {\r
                //総ピクセル数を計算\r
-               int n=i_histgram.length;\r
-               int sum_of_pixel=i_histgram.total_of_data;\r
-               int[] hist=i_histgram.data;\r
+               int n=i_histogram.length;\r
+               int sum_of_pixel=i_histogram.total_of_data;\r
+               int[] hist=i_histogram.data;\r
                // 閾値ピクセル数確定\r
                final int th_pixcels = sum_of_pixel * this._persentage / 100;\r
                int th_wk;\r
@@ -2,7 +2,7 @@ package jp.nyatla.nyartoolkit.core.analyzer.raster;
 \r
 import jp.nyatla.nyartoolkit.NyARException;\r
 import jp.nyatla.nyartoolkit.core.raster.*;\r
-import jp.nyatla.nyartoolkit.core.types.NyARHistgram;\r
+import jp.nyatla.nyartoolkit.core.types.NyARHistogram;\r
 import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
 /**\r
  * 画像のヒストグラムを計算します。\r
@@ -10,9 +10,9 @@ import jp.nyatla.nyartoolkit.core.types.NyARIntSize;
  * \r
  * \r
  */\r
-public class NyARRasterAnalyzer_Histgram\r
+public class NyARRasterAnalyzer_Histogram\r
 {\r
-       protected ICreateHistgramImpl _histImpl;\r
+       protected ICreateHistogramImpl _histImpl;\r
        /**\r
         * ヒストグラム解析の縦方向スキップ数。継承クラスはこのライン数づつ\r
         * スキップしながらヒストグラム計算を行うこと。\r
@@ -20,7 +20,7 @@ public class NyARRasterAnalyzer_Histgram
        protected int _vertical_skip;\r
        \r
        \r
-       public NyARRasterAnalyzer_Histgram(int i_raster_format,int i_vertical_interval) throws NyARException\r
+       public NyARRasterAnalyzer_Histogram(int i_raster_format,int i_vertical_interval) throws NyARException\r
        {\r
                if(!initInstance(i_raster_format,i_vertical_interval)){\r
                        throw new NyARException();\r
@@ -31,22 +31,22 @@ public class NyARRasterAnalyzer_Histgram
                switch (i_raster_format) {\r
                case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
                case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
-                       this._histImpl = new NyARRasterThresholdAnalyzer_Histgram_BYTE1D_RGB_24();\r
+                       this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_BYTE1D_RGB_24();\r
                        break;\r
                case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
-                       this._histImpl = new NyARRasterThresholdAnalyzer_Histgram_INT1D_GRAY_8();\r
+                       this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_INT1D_GRAY_8();\r
                        break;\r
                case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32:\r
-                       this._histImpl = new NyARRasterThresholdAnalyzer_Histgram_BYTE1D_B8G8R8X8_32();\r
+                       this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_BYTE1D_B8G8R8X8_32();\r
                        break;\r
                case INyARRaster.BUFFERFORMAT_BYTE1D_X8R8G8B8_32:\r
-                       this._histImpl = new NyARRasterThresholdAnalyzer_Histgram_BYTE1D_X8R8G8B8_32();\r
+                       this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_BYTE1D_X8R8G8B8_32();\r
                        break;\r
                case INyARRaster.BUFFERFORMAT_WORD1D_R5G6B5_16LE:\r
-                       this._histImpl = new NyARRasterThresholdAnalyzer_Histgram_WORD1D_R5G6B5_16LE();\r
+                       this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_WORD1D_R5G6B5_16LE();\r
                        break;\r
                case INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32:\r
-                       this._histImpl = new NyARRasterThresholdAnalyzer_Histgram_INT1D_X8R8G8B8_32();\r
+                       this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_INT1D_X8R8G8B8_32();\r
                        break;\r
                default:\r
                        return false;\r
@@ -64,53 +64,53 @@ public class NyARRasterAnalyzer_Histgram
        }\r
 \r
        /**\r
-        * o_histgramにヒストグラムを出力します。\r
+        * o_histogramにヒストグラムを出力します。\r
         * @param i_input\r
-        * @param o_histgram\r
+        * @param o_histogram\r
         * @return\r
         * @throws NyARException\r
         */\r
-       public int analyzeRaster(INyARRaster i_input,NyARHistgram o_histgram) throws NyARException\r
+       public int analyzeRaster(INyARRaster i_input,NyARHistogram o_histogram) throws NyARException\r
        {\r
                \r
                final NyARIntSize size=i_input.getSize();\r
                //最大画像サイズの制限\r
                assert size.w*size.h<0x40000000;\r
-               assert o_histgram.length==256;//現在は固定\r
+               assert o_histogram.length==256;//現在は固定\r
 \r
-               int[] h=o_histgram.data;\r
+               int[] h=o_histogram.data;\r
                //ヒストグラム初期化\r
-               for (int i = o_histgram.length-1; i >=0; i--){\r
+               for (int i = o_histogram.length-1; i >=0; i--){\r
                        h[i] = 0;\r
                }\r
-               o_histgram.total_of_data=size.w*size.h/this._vertical_skip;\r
-               return this._histImpl.createHistgram(i_input, size,h,this._vertical_skip);              \r
+               o_histogram.total_of_data=size.w*size.h/this._vertical_skip;\r
+               return this._histImpl.createHistogram(i_input, size,h,this._vertical_skip);             \r
        }\r
        \r
-       interface ICreateHistgramImpl\r
+       interface ICreateHistogramImpl\r
        {\r
-               public int createHistgram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histgram,int i_skip);\r
+               public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip);\r
        }\r
 \r
-       class NyARRasterThresholdAnalyzer_Histgram_INT1D_GRAY_8 implements ICreateHistgramImpl\r
+       class NyARRasterThresholdAnalyzer_Histogram_INT1D_GRAY_8 implements ICreateHistogramImpl\r
        {\r
-               public int createHistgram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histgram,int i_skip)\r
+               public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
                {\r
                        assert (i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
                        final int[] input=(int[]) i_reader.getBuffer();\r
                        for (int y = i_size.h-1; y >=0 ; y-=i_skip){\r
                                int pt=y*i_size.w;\r
                                for (int x = i_size.w-1; x >=0; x--) {\r
-                                       o_histgram[input[pt]]++;\r
+                                       o_histogram[input[pt]]++;\r
                                        pt++;\r
                                }\r
                        }\r
                        return i_size.w*i_size.h;\r
                }       \r
        }\r
-       class NyARRasterThresholdAnalyzer_Histgram_INT1D_X8R8G8B8_32 implements ICreateHistgramImpl\r
+       class NyARRasterThresholdAnalyzer_Histogram_INT1D_X8R8G8B8_32 implements ICreateHistogramImpl\r
        {\r
-               public int createHistgram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histgram,int i_skip)\r
+               public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
                {\r
                        assert (i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32));\r
                        final int[] input=(int[]) i_reader.getBuffer();\r
@@ -118,7 +118,7 @@ public class NyARRasterAnalyzer_Histgram
                                int pt=y*i_size.w;\r
                                for (int x = i_size.w-1; x >=0; x--) {\r
                                        int p=input[pt];\r
-                                       o_histgram[((p& 0xff)+(p& 0xff)+(p& 0xff))/3]++;\r
+                                       o_histogram[((p& 0xff)+(p& 0xff)+(p& 0xff))/3]++;\r
                                        pt++;\r
                                }\r
                        }\r
@@ -127,9 +127,9 @@ public class NyARRasterAnalyzer_Histgram
        }\r
 \r
        \r
-       class NyARRasterThresholdAnalyzer_Histgram_BYTE1D_RGB_24 implements ICreateHistgramImpl\r
+       class NyARRasterThresholdAnalyzer_Histogram_BYTE1D_RGB_24 implements ICreateHistogramImpl\r
        {\r
-               public int createHistgram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histgram,int i_skip)\r
+               public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
                {\r
                        assert (\r
                                        i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24)||\r
@@ -142,27 +142,27 @@ public class NyARRasterAnalyzer_Histgram
                                int x,v;\r
                                for (x = pix_count-1; x >=pix_mod_part; x--) {\r
                                        v=((input[pt+0]& 0xff)+(input[pt+1]& 0xff)+(input[pt+2]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        pt+=3;\r
                                }\r
                                //タイリング\r
                                for (;x>=0;x-=8){\r
                                        v=((input[pt+ 0]& 0xff)+(input[pt+ 1]& 0xff)+(input[pt+ 2]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        v=((input[pt+ 3]& 0xff)+(input[pt+ 4]& 0xff)+(input[pt+ 5]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        v=((input[pt+ 6]& 0xff)+(input[pt+ 7]& 0xff)+(input[pt+ 8]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        v=((input[pt+ 9]& 0xff)+(input[pt+10]& 0xff)+(input[pt+11]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        v=((input[pt+12]& 0xff)+(input[pt+13]& 0xff)+(input[pt+14]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        v=((input[pt+15]& 0xff)+(input[pt+16]& 0xff)+(input[pt+17]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        v=((input[pt+18]& 0xff)+(input[pt+19]& 0xff)+(input[pt+20]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        v=((input[pt+21]& 0xff)+(input[pt+22]& 0xff)+(input[pt+23]& 0xff))/3;\r
-                                       o_histgram[v]++;\r
+                                       o_histogram[v]++;\r
                                        pt+=3*8;\r
                                }\r
                        }\r
@@ -170,9 +170,9 @@ public class NyARRasterAnalyzer_Histgram
                }\r
        }\r
 \r
-       class NyARRasterThresholdAnalyzer_Histgram_BYTE1D_B8G8R8X8_32 implements ICreateHistgramImpl\r
+       class NyARRasterThresholdAnalyzer_Histogram_BYTE1D_B8G8R8X8_32 implements ICreateHistogramImpl\r
        {\r
-               public int createHistgram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histgram,int i_skip)\r
+               public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
                {\r
                assert(i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32));\r
                byte[] input = (byte[])i_reader.getBuffer();\r
@@ -185,28 +185,28 @@ public class NyARRasterAnalyzer_Histgram
                    for (x = pix_count - 1; x >= pix_mod_part; x--)\r
                    {\r
                        v = ((input[pt + 0] & 0xff) + (input[pt + 1] & 0xff) + (input[pt + 2] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        pt += 4;\r
                    }\r
                    //タイリング\r
                    for (; x >= 0; x -= 8)\r
                    {\r
                        v = ((input[pt + 0] & 0xff) + (input[pt + 1] & 0xff) + (input[pt + 2] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 4] & 0xff) + (input[pt + 5] & 0xff) + (input[pt + 6] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 8] & 0xff) + (input[pt + 9] & 0xff) + (input[pt + 10] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 12] & 0xff) + (input[pt + 13] & 0xff) + (input[pt + 14] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 16] & 0xff) + (input[pt + 17] & 0xff) + (input[pt + 18] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 20] & 0xff) + (input[pt + 21] & 0xff) + (input[pt + 22] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 24] & 0xff) + (input[pt + 25] & 0xff) + (input[pt + 26] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 28] & 0xff) + (input[pt + 29] & 0xff) + (input[pt + 30] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        pt += 4 * 8;\r
                    }\r
                }\r
@@ -214,9 +214,9 @@ public class NyARRasterAnalyzer_Histgram
            }\r
        }\r
 \r
-       class NyARRasterThresholdAnalyzer_Histgram_BYTE1D_X8R8G8B8_32 implements ICreateHistgramImpl\r
+       class NyARRasterThresholdAnalyzer_Histogram_BYTE1D_X8R8G8B8_32 implements ICreateHistogramImpl\r
        {\r
-               public int createHistgram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histgram,int i_skip)\r
+               public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
                {\r
                assert(i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_X8R8G8B8_32));\r
                byte[] input = (byte[])i_reader.getBuffer();\r
@@ -229,28 +229,28 @@ public class NyARRasterAnalyzer_Histgram
                    for (x = pix_count - 1; x >= pix_mod_part; x--)\r
                    {\r
                        v = ((input[pt + 1] & 0xff) + (input[pt + 2] & 0xff) + (input[pt + 3] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        pt += 4;\r
                    }\r
                    //タイリング\r
                    for (; x >= 0; x -= 8)\r
                    {\r
                        v = ((input[pt + 1] & 0xff) + (input[pt + 2] & 0xff) + (input[pt + 3] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 5] & 0xff) + (input[pt + 6] & 0xff) + (input[pt + 7] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 9] & 0xff) + (input[pt + 10] & 0xff) + (input[pt + 11] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 13] & 0xff) + (input[pt + 14] & 0xff) + (input[pt + 15] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 17] & 0xff) + (input[pt + 18] & 0xff) + (input[pt + 19] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 21] & 0xff) + (input[pt + 22] & 0xff) + (input[pt + 23] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 25] & 0xff) + (input[pt + 26] & 0xff) + (input[pt + 27] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v = ((input[pt + 29] & 0xff) + (input[pt + 30] & 0xff) + (input[pt + 31] & 0xff)) / 3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        pt += 4 * 8;\r
                    }\r
                }\r
@@ -258,9 +258,9 @@ public class NyARRasterAnalyzer_Histgram
            }\r
        }\r
 \r
-       class NyARRasterThresholdAnalyzer_Histgram_WORD1D_R5G6B5_16LE implements ICreateHistgramImpl\r
+       class NyARRasterThresholdAnalyzer_Histogram_WORD1D_R5G6B5_16LE implements ICreateHistogramImpl\r
        {\r
-               public int createHistgram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histgram,int i_skip)\r
+               public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
                {\r
                assert(i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_WORD1D_R5G6B5_16LE));\r
                short[] input = (short[])i_reader.getBuffer();\r
@@ -274,7 +274,7 @@ public class NyARRasterAnalyzer_Histgram
                    {\r
                        v =(int)input[pt];\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        pt++;\r
                    }\r
                    //タイリング\r
@@ -282,28 +282,28 @@ public class NyARRasterAnalyzer_Histgram
                    {\r
                        v =(int)input[pt];pt++;\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v =(int)input[pt];pt++;\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v =(int)input[pt];pt++;\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v =(int)input[pt];pt++;\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v =(int)input[pt];pt++;\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v =(int)input[pt];pt++;\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v =(int)input[pt];pt++;\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                        v =(int)input[pt];pt++;\r
                        v = (((v & 0xf800) >> 8) + ((v & 0x07e0) >> 3) + ((v & 0x001f) << 3))/3;\r
-                       o_histgram[v]++;\r
+                       o_histogram[v]++;\r
                    }\r
                }\r
                return i_size.w*i_size.h;\r
index c1c36d8..3c7fb9d 100644 (file)
@@ -1,10 +1,10 @@
 package jp.nyatla.nyartoolkit.core.analyzer.raster.threshold;\r
 \r
 import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.analyzer.histgram.*;\r
+import jp.nyatla.nyartoolkit.core.analyzer.histogram.*;\r
 import jp.nyatla.nyartoolkit.core.analyzer.raster.*;\r
 import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
-import jp.nyatla.nyartoolkit.core.types.NyARHistgram;\r
+import jp.nyatla.nyartoolkit.core.types.NyARHistogram;\r
 /**\r
  * 明点と暗点をPタイル法で検出して、その中央値を閾値とする。\r
  * \r
@@ -12,9 +12,9 @@ import jp.nyatla.nyartoolkit.core.types.NyARHistgram;
  */\r
 public class NyARRasterThresholdAnalyzer_SlidePTile implements INyARRasterThresholdAnalyzer\r
 {\r
-       protected NyARRasterAnalyzer_Histgram _raster_analyzer;\r
-       private NyARHistgramAnalyzer_SlidePTile _sptile;\r
-       private NyARHistgram _histgram;\r
+       protected NyARRasterAnalyzer_Histogram _raster_analyzer;\r
+       private NyARHistogramAnalyzer_SlidePTile _sptile;\r
+       private NyARHistogram _histogram;\r
        public void setVerticalInterval(int i_step)\r
        {\r
                this._raster_analyzer.setVerticalInterval(i_step);\r
@@ -27,17 +27,17 @@ public class NyARRasterThresholdAnalyzer_SlidePTile implements INyARRasterThresh
                if(!initInstance(i_raster_format,i_vertical_interval)){\r
                        throw new NyARException();\r
                }\r
-               this._sptile=new NyARHistgramAnalyzer_SlidePTile(i_persentage);\r
-               this._histgram=new NyARHistgram(256);\r
+               this._sptile=new NyARHistogramAnalyzer_SlidePTile(i_persentage);\r
+               this._histogram=new NyARHistogram(256);\r
        }\r
        protected boolean initInstance(int i_raster_format,int i_vertical_interval) throws NyARException\r
        {\r
-               this._raster_analyzer=new NyARRasterAnalyzer_Histgram(i_raster_format,i_vertical_interval);\r
+               this._raster_analyzer=new NyARRasterAnalyzer_Histogram(i_raster_format,i_vertical_interval);\r
                return true;\r
        }\r
        public int analyzeRaster(INyARRaster i_input) throws NyARException\r
        {\r
-               this._raster_analyzer.analyzeRaster(i_input, this._histgram);\r
-               return this._sptile.getThreshold(this._histgram);\r
+               this._raster_analyzer.analyzeRaster(i_input, this._histogram);\r
+               return this._sptile.getThreshold(this._histogram);\r
        }\r
 }\r
index 8808f35..9a9623a 100644 (file)
 package jp.nyatla.nyartoolkit.core.rasterfilter;\r
 \r
 import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.analyzer.raster.NyARRasterAnalyzer_Histgram;\r
+import jp.nyatla.nyartoolkit.core.analyzer.raster.NyARRasterAnalyzer_Histogram;\r
 import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
-import jp.nyatla.nyartoolkit.core.types.NyARHistgram;\r
+import jp.nyatla.nyartoolkit.core.types.NyARHistogram;\r
 /**\r
  * ヒストグラムを平滑化します。\r
  *\r
  */\r
 public class NyARRasterFilter_EqualizeHist extends NyARRasterFilter_CustomToneTable\r
 {\r
-       private NyARRasterAnalyzer_Histgram _hist_analyzer;\r
-       private NyARHistgram _histgram=new NyARHistgram(256);\r
+       private NyARRasterAnalyzer_Histogram _hist_analyzer;\r
+       private NyARHistogram _histogram=new NyARHistogram(256);\r
        public NyARRasterFilter_EqualizeHist(int i_raster_type,int i_sample_interval) throws NyARException\r
        {\r
                super(i_raster_type);\r
-               this._hist_analyzer=new NyARRasterAnalyzer_Histgram(i_raster_type,i_sample_interval);\r
+               this._hist_analyzer=new NyARRasterAnalyzer_Histogram(i_raster_type,i_sample_interval);\r
        }\r
        public void doFilter(INyARRaster i_input, INyARRaster i_output) throws NyARException\r
        {\r
                //ヒストグラムを得る\r
-               NyARHistgram hist=this._histgram;\r
+               NyARHistogram hist=this._histogram;\r
                this._hist_analyzer.analyzeRaster(i_input,hist);\r
                //変換テーブルを作成\r
-               int hist_total=this._histgram.total_of_data;\r
+               int hist_total=this._histogram.total_of_data;\r
                int min=hist.getMinData();\r
-               int hist_size=this._histgram.length;\r
+               int hist_size=this._histogram.length;\r
                int sum=0;\r
                for(int i=0;i<hist_size;i++){\r
                        sum+=hist.data[i];\r
@@ -3,7 +3,7 @@ package jp.nyatla.nyartoolkit.core.types;
 /**\r
  * ヒストグラムを格納するクラスです。\r
  */\r
-public class NyARHistgram\r
+public class NyARHistogram\r
 {\r
        /**\r
         * サンプリング値の格納変数\r
@@ -20,7 +20,7 @@ public class NyARHistgram
        \r
        \r
        \r
-       public NyARHistgram(int i_length)\r
+       public NyARHistogram(int i_length)\r
        {\r
                this.data=new int[i_length];\r
                this.length=i_length;\r
index 7279a77..380ff6b 100644 (file)
@@ -114,7 +114,7 @@ public class NyARRasterImageIO
         * @param o_out\r
         * @throws NyARException\r
         */\r
-       public static void copy(NyARHistgram i_in,int i_l,int i_t,int i_h,Graphics i_g) throws NyARException\r
+       public static void copy(NyARHistogram i_in,int i_l,int i_t,int i_h,Graphics i_g) throws NyARException\r
        {\r
                //正規化のための定数を出す。\r
                int max=0;\r
index 769f334..c99cec5 100644 (file)
@@ -893,7 +893,7 @@ public class LabelingCamera extends Frame implements JmfCaptureListener
                        this.getGraphics().drawImage(this._bimg, 32 + 320, 32 + 240, 320 + 32 + 320, 240 + 32 + 240, 0, 240, 320, 0, this);
 
                        // 画像3
-                       // threshold.debugDrawHistgramMap(_workraster, _workraster2);
+                       // threshold.debugDrawHistogramMap(_workraster, _workraster2);
                        // this._bimg2.setImage(this._workraster2);
                        // this.getGraphics().drawImage(this._bimg2, 32+320, 32+240,320+32+320,240+32+240,0,240,320,0, this);
 
@@ -913,7 +913,7 @@ public class LabelingCamera extends Frame implements JmfCaptureListener
                        // 画像5
 
                        /*
-                        * threshold2.debugDrawHistgramMap(_workraster, _workraster2); this._bimg2.drawImage(this._workraster2); this.getGraphics().drawImage(this._bimg2,
+                        * threshold2.debugDrawHistogramMap(_workraster, _workraster2); this._bimg2.drawImage(this._workraster2); this.getGraphics().drawImage(this._bimg2,
                         * 32+320, 32+480,320+32+320,480+32+240,0,240,320,0, this);
                         */