示例#1
0
        /**
         * この関数は、インスタンスを初期化します。
         * コンストラクタから呼び出します。
         * @see NyARDetectMarker#NyARDetectMarker(NyARParam, NyARCode[], double[], int, int)
         * @param i_ref_param
         * Check see also
         * @param i_ref_code
         * Check see also
         * @param i_marker_width
         * Check see also
         * @param i_number_of_code
         * Check see also
         * @param i_input_raster_type
         * Check see also
         * @
         */
        protected void initInstance(
            NyARParam i_ref_param,
            NyARCode[] i_ref_code,
            double[] i_marker_width,
            int i_number_of_code)
        {
            NyARIntSize scr_size = i_ref_param.getScreenSize();
            // 解析オブジェクトを作る
            int cw = i_ref_code[0].getWidth();
            int ch = i_ref_code[0].getHeight();

            this._transmat = new NyARTransMat(i_ref_param);
            //NyARToolkitプロファイル
            this._square_detect = new RleDetector(new NyARColorPatt_Perspective(cw, ch, 4, 25), i_ref_code, i_number_of_code, i_ref_param);

            //実サイズ保存
            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 = NyARBinRaster.createInstance(scr_size.w, scr_size.h);
            return;
        }
示例#2
0
        protected NyARSingleDetectMarker(NyARParam i_ref_param, NyARCode i_ref_code, double i_marker_width)
        {
            this._deviation_data = new NyARMatchPattDeviationColorData(i_ref_code.getWidth(), i_ref_code.getHeight());
            this._match_patt     = new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code);
            this._offset         = new NyARRectOffset();
            this._offset.setSquare(i_marker_width);
            this._coordline = new NyARCoord2Linear(i_ref_param.getScreenSize(), i_ref_param.getDistortionFactor());
            //2値画像バッファを作る
            NyARIntSize s = i_ref_param.getScreenSize();

            this._bin_raster = NyARBinRaster.createInstance(s.w, s.h);
        }