Exemplo n.º 1
0
        /**
         * @param i_number_of_sample
         * サンプラが検出する最大数。
         * 通常100~200以上を指定します。(QVGA画像あたり、100個を基準にします。)
         * 数が少なすぎると、検出率が低下します。最低でも、NyARTrackerに設定するターゲット数の合計*2以上を指定してください。
         * @param i_ref_raster_distortion
         * 歪み矯正の為のオブジェクトを指定します。歪み矯正が必要ない時は、NULLを指定します。
         * @param i_width
         * ソース画像のサイズ
         * @param i_height
         * ソース画像のサイズ
         * @param i_depth
         * 解像度の深さ(1/(2^n))倍の画像として処理する。
         * @param i_is_alloc
         * ベースラスタのバッファを内部確保外部参照にするかのフラグです。
         * trueの場合、バッファは内部に確保され、{@link #wrapBuffer}関数が使用できなくなります。
         * @throws NyARException
         */
        public NyARTrackerSource_Reference(int i_number_of_sample, INyARCameraDistortionFactor i_ref_raster_distortion, int i_width, int i_height, int i_depth, bool i_is_alloc)
            : base((int)Math.Pow(2, i_depth))
        {
            Debug.Assert(i_depth > 0);
            int div = this._rob_resolution;

            //主GSラスタ
            this._base_raster = new NyARGrayscaleRaster(i_width, i_height, NyARBufferType.INT1D_GRAY_8, i_is_alloc);
            this._gs_graphics = NyARGsRasterGraphicsFactory.CreateDriver(this._base_raster);
            //Roberts変換ラスタ
            this._rb_source = new NyARGrayscaleRaster(i_width / div, i_height / div, NyARBufferType.INT1D_GRAY_8, true);
            //Robertsラスタは最も解像度の低いラスタと同じ
            this._rbraster   = new NyARGrayscaleRaster(i_width / div, i_height / div, NyARBufferType.INT1D_GRAY_8, true);
            this._vec_reader = new NyARVectorReader_INT1D_GRAY_8(this._base_raster, i_ref_raster_distortion, this._rbraster);
            //samplerとsampleout
            this._sampler    = new LowResolutionLabelingSampler(i_width, i_height, (int)Math.Pow(2, i_depth));
            this._sample_out = new LowResolutionLabelingSamplerOut(i_number_of_sample);
        }
 /**
  * @param i_number_of_sample
  * サンプラが検出する最大数。
  * 通常100~200以上を指定します。(QVGA画像あたり、100個を基準にします。)
  * 数が少なすぎると、検出率が低下します。最低でも、NyARTrackerに設定するターゲット数の合計*2以上を指定してください。
  * @param i_ref_raster_distortion
  * 歪み矯正の為のオブジェクトを指定します。歪み矯正が必要ない時は、NULLを指定します。
  * @param i_width
  * ソース画像のサイズ
  * @param i_height
  * ソース画像のサイズ
  * @param i_depth
  * 解像度の深さ(1/(2^n))倍の画像として処理する。
  * @param i_is_alloc
  * ベースラスタのバッファを内部確保外部参照にするかのフラグです。
  * trueの場合、バッファは内部に確保され、{@link #wrapBuffer}関数が使用できなくなります。
  * @throws NyARException
  */
 public NyARTrackerSource_Reference(int i_number_of_sample, INyARCameraDistortionFactor i_ref_raster_distortion, int i_width, int i_height, int i_depth, bool i_is_alloc)
     : base((int)Math.Pow(2, i_depth))
 {
     Debug.Assert(i_depth>0);
     int div=this._rob_resolution;
     //主GSラスタ
     this._base_raster=new NyARGrayscaleRaster(i_width,i_height,NyARBufferType.INT1D_GRAY_8,i_is_alloc);
     this._gs_graphics = NyARGsRasterGraphicsFactory.CreateDriver(this._base_raster);
     //Roberts変換ラスタ
     this._rb_source=new NyARGrayscaleRaster(i_width/div,i_height/div,NyARBufferType.INT1D_GRAY_8, true);
     //Robertsラスタは最も解像度の低いラスタと同じ
     this._rbraster=new NyARGrayscaleRaster(i_width/div,i_height/div,NyARBufferType.INT1D_GRAY_8, true);
     this._vec_reader=new NyARVectorReader_INT1D_GRAY_8(this._base_raster,i_ref_raster_distortion,this._rbraster);
     //samplerとsampleout
     this._sampler=new LowResolutionLabelingSampler(i_width, i_height,(int)Math.Pow(2,i_depth));
     this._sample_out=new LowResolutionLabelingSamplerOut(i_number_of_sample);
 }