Example #1
0
        protected void initInstance(
            NyARParam i_ref_param,
            NyARCode[] i_ref_code,
            double[] i_marker_width,
            int i_number_of_code,
            int i_input_raster_type)
        {
            NyARIntSize scr_size = i_ref_param.getScreenSize();
            // 解析オブジェクトを作る
            int cw = i_ref_code[0].getWidth();
            int ch = i_ref_code[0].getHeight();

            //detectMarkerのコールバック関数
            this._detect_cb = new DetectSquareCB(
                new NyARColorPatt_Perspective_O2(cw, ch, 4, 25),
                i_ref_code, i_number_of_code, i_ref_param);
            this._transmat = new NyARTransMat(i_ref_param);
            //NyARToolkitプロファイル
            this._square_detect = new NyARSquareContourDetector_Rle(i_ref_param.getScreenSize());
            this._tobin_filter  = new NyARRasterFilter_ARToolkitThreshold(100, i_input_raster_type);

            //実サイズ保存
            this._offset = NyARRectOffset.createArray(i_number_of_code);
            for (int i = 0; i < i_number_of_code; i++)
            {
                this._offset[i].setSquare(i_marker_width[i]);
            }
            //2値画像バッファを作る
            this._bin_raster = new NyARBinRaster(scr_size.w, scr_size.h);
            return;
        }
        protected void initInstance(NyARParam i_param, INyIdMarkerDataEncoder i_encoder, double i_marker_width, int i_raster_format)
        {
            //初期化済?
            Debug.Assert(this._initialized == false);

            NyARIntSize scr_size = i_param.getScreenSize();

            // 解析オブジェクトを作る
            this._square_detect = new NyARSquareContourDetector_Rle(scr_size);
            this._transmat      = new NyARTransMat(i_param);
            this._callback      = new DetectSquareCB(i_param, i_encoder);

            // 2値画像バッファを作る
            this._bin_raster = new NyARBinRaster(scr_size.w, scr_size.h);
            //ワーク用のデータオブジェクトを2個作る
            this._data_current     = i_encoder.createDataInstance();
            this._tobin_filter     = new NyARRasterFilter_ARToolkitThreshold(110, i_raster_format);
            this._threshold_detect = new NyARRasterThresholdAnalyzer_SlidePTile(15, i_raster_format, 4);
            this._initialized      = true;
            this._is_active        = false;
            this._offset           = new NyARRectOffset();
            this._offset.setSquare(i_marker_width);
            return;
        }
        protected void initInstance(
            INyARColorPatt i_patt_inst,
            NyARSquareContourDetector i_sqdetect_inst,
            INyARTransMat i_transmat_inst,
            INyARRasterFilter_Rgb2Bin i_filter,
            NyARParam i_ref_param,
            NyARCode i_ref_code,
            double i_marker_width)
        {
            NyARIntSize scr_size = i_ref_param.getScreenSize();

            // 解析オブジェクトを作る
            this._square_detect = i_sqdetect_inst;
            this._transmat      = i_transmat_inst;
            this._tobin_filter  = i_filter;
            //2値画像バッファを作る
            this._bin_raster = new NyARBinRaster(scr_size.w, scr_size.h);
            //_detect_cb
            this._detect_cb = new DetectSquareCB(i_patt_inst, i_ref_code, i_ref_param);
            //オフセットを作成
            this._offset = new NyARRectOffset();
            this._offset.setSquare(i_marker_width);
            return;
        }
        protected void initInstance(NyARParam i_param, INyIdMarkerDataEncoder i_encoder, double i_marker_width, int i_raster_format)
        {
            //初期化済?
            Debug.Assert(this._initialized == false);

            NyARIntSize scr_size = i_param.getScreenSize();
            // 解析オブジェクトを作る
            this._square_detect = new NyARSquareContourDetector_Rle(scr_size);
            this._transmat = new NyARTransMat(i_param);
            this._callback = new DetectSquareCB(i_param, i_encoder);

            // 2値画像バッファを作る
            this._bin_raster = new NyARBinRaster(scr_size.w, scr_size.h);
            //ワーク用のデータオブジェクトを2個作る
            this._data_current = i_encoder.createDataInstance();
            this._tobin_filter = new NyARRasterFilter_ARToolkitThreshold(110, i_raster_format);
            this._threshold_detect = new NyARRasterThresholdAnalyzer_SlidePTile(15, i_raster_format, 4);
            this._initialized = true;
            this._is_active = false;
            this._offset = new NyARRectOffset();
            this._offset.setSquare(i_marker_width);
            return;

        }
        protected void initInstance(
            INyARColorPatt i_patt_inst,
            NyARSquareContourDetector i_sqdetect_inst,
            INyARTransMat i_transmat_inst,
            INyARRasterFilter_Rgb2Bin i_filter,
            NyARParam i_ref_param,
            NyARCode i_ref_code,
            double i_marker_width)
        {
            NyARIntSize scr_size = i_ref_param.getScreenSize();
            // 解析オブジェクトを作る
            this._square_detect = i_sqdetect_inst;
            this._transmat = i_transmat_inst;
            this._tobin_filter = i_filter;
            //2値画像バッファを作る
            this._bin_raster = new NyARBinRaster(scr_size.w, scr_size.h);
            //_detect_cb
            this._detect_cb = new DetectSquareCB(i_patt_inst, i_ref_code, i_ref_param);
            //オフセットを作成
            this._offset = new NyARRectOffset();
            this._offset.setSquare(i_marker_width);
            return;

        }