示例#1
0
        /**
         * コンストラクタから呼び出す共通な初期化部分です。
         * @param i_dist_factor
         * @param i_prjmat
         * @throws NyARException
         */
        protected void initInstance(NyARIntSize i_screen, double i_near, double i_far, NyARPerspectiveProjectionMatrix i_prjmat, NyARCameraDistortionFactor i_dist_factor)
        {
            int number_of_reality_target = this.MAX_LIMIT_KNOWN + this.MAX_LIMIT_UNKNOWN;

            //演算インスタンス
            this._transmat = new NyARTransMat(i_dist_factor, i_prjmat);

            //データインスタンス
            this._pool  = new NyARRealityTargetPool(number_of_reality_target, i_prjmat);
            this.target = new NyARRealityTargetList(number_of_reality_target);
            //Trackerの特性値
            this._tracker = new NyARTracker((this.MAX_LIMIT_KNOWN + this.MAX_LIMIT_UNKNOWN) * 2, 1, this.MAX_LIMIT_KNOWN * 2);
            //フラスタムの計算とスクリーンサイズの保存
            this._ref_prjmat = i_prjmat;
            this._frustum    = new NyARFrustum(i_prjmat, i_screen.w, i_screen.h, i_near, i_far);

            //初期化
            this._number_of_dead = this._number_of_unknown = this._number_of_known = 0;
            return;
        }
        public bool InitializeApplication(Form1 topLevelForm, CaptureDevice i_cap_device)
        {
            this._top_form          = topLevelForm;
            topLevelForm.ClientSize = new Size(SCREEN_WIDTH, SCREEN_HEIGHT);
            //キャプチャを作る(QVGAでフレームレートは30)
            i_cap_device.SetCaptureListener(this);
            i_cap_device.PrepareCapture(SCREEN_WIDTH, SCREEN_HEIGHT, 30);
            this._cap = i_cap_device;

            //ARの設定

            //ARラスタを作る(DirectShowキャプチャ仕様)。
            this._raster = new DsRgbRaster(i_cap_device.video_width, i_cap_device.video_height, NyARBufferType.OBJECT_CS_Bitmap);

            this.gs     = new NyARGrayscaleRaster(i_cap_device.video_width, i_cap_device.video_height);
            this.filter = NyARRgb2GsFilterFactory.createRgbAveDriver(this._raster);

            this.tracker     = new NyARTracker(100, 1, 10);
            this.tracksource = new NyARTrackerSource_Reference(100, null, i_cap_device.video_width, i_cap_device.video_height, 2, false);
            return(true);
        }
        public bool InitializeApplication(Form1 topLevelForm, CaptureDevice i_cap_device)
        {
            this._top_form = topLevelForm;
            topLevelForm.ClientSize=new Size(SCREEN_WIDTH,SCREEN_HEIGHT);
            //キャプチャを作る(QVGAでフレームレートは30)
            i_cap_device.SetCaptureListener(this);
            i_cap_device.PrepareCapture(SCREEN_WIDTH, SCREEN_HEIGHT, 30);
            this._cap = i_cap_device;
            
            //ARの設定

            //ARラスタを作る(DirectShowキャプチャ仕様)。
            this._raster = new DsRgbRaster(i_cap_device.video_width, i_cap_device.video_height,NyARBufferType.OBJECT_CS_Bitmap);

            this.gs = new NyARGrayscaleRaster(i_cap_device.video_width, i_cap_device.video_height);
            this.filter = NyARRgb2GsFilterFactory.createRgbAveDriver(this._raster);

            this.tracker = new NyARTracker(100, 1, 10);
            this.tracksource = new NyARTrackerSource_Reference(100, null, i_cap_device.video_width, i_cap_device.video_height,2, false);
            return true;
        }
示例#4
0
	    /**
	     * コンストラクタから呼び出す共通な初期化部分です。
	     * @param i_dist_factor
	     * @param i_prjmat
	     * @throws NyARException
	     */
	    protected void initInstance(NyARIntSize i_screen,double i_near,double i_far,NyARPerspectiveProjectionMatrix i_prjmat,INyARCameraDistortionFactor i_dist_factor)
	    {
		    int number_of_reality_target=this.MAX_LIMIT_KNOWN+this.MAX_LIMIT_UNKNOWN;
		    //演算インスタンス
		    this._transmat=new NyARTransMat(i_dist_factor,i_prjmat);

		    //データインスタンス
		    this._pool=new NyARRealityTargetPool(number_of_reality_target,i_prjmat);
		    this.target=new NyARRealityTargetList(number_of_reality_target);
		    //Trackerの特性値
		    this._tracker=new NyARTracker((this.MAX_LIMIT_KNOWN+this.MAX_LIMIT_UNKNOWN)*2,1,this.MAX_LIMIT_KNOWN*2);
		    //フラスタムの計算とスクリーンサイズの保存
		    this._ref_prjmat=i_prjmat;
		    this._frustum=new NyARFrustum(i_prjmat,i_screen.w,i_screen.h, i_near, i_far);

		    //初期化
		    this._number_of_dead=this._number_of_unknown=this._number_of_known=0;
		    return;
	    }