public NyARSingleDetectMarker_NyARTK_FITTING_ARTKv2(NyARParam i_ref_param, NyARCode i_ref_code, double i_marker_width)
     : base(i_ref_param, i_ref_code, i_marker_width)
 {
     this._inst_patt = new NyARColorPatt_Perspective(i_ref_code.getWidth(), i_ref_code.getHeight(), 4, 25);
       this._transmat = new NyARTransMat_ARToolKit(i_ref_param);
       this._square_detect = new NyARSingleDetectMarker_ARTKv2.ARTKDetector(this, i_ref_param.getScreenSize());
 }
Esempio n. 2
0
 /**
  * この関数は、ARToolKitスタイルのカメラパラメータから、 CameraFrustamを計算します。
  * カメラパラメータの要素のうち、ProjectionMatrix成分のみを使います。
  * @param i_arparam
  * ARToolKitスタイルのカメラパラメータ。
  * @param i_scale
  * スケール値を指定します。1=1mmです。10ならば1=1cm,1000ならば1=1mです。
  * 2.53以前のNyARToolkitと互換性を持たせるときは、{@link #SCALE_FACTOR_toCameraFrustumRH_NYAR2}を指定してください。
  * @param i_near
  * 視錐体のnearPointを指定します。単位は、i_scaleに設定した値で決まります。
  * @param i_far
  * 視錐体のfarPointを指定します。単位は、i_scaleに設定した値で決まります。
  * @param o_gl_projection
  * OpenGLスタイルのProjectionMatrixです。double[16]を指定します。
  */
 public static void ToCameraFrustumRH(NyARParam i_arparam, double i_scale, double i_near, double i_far, ref Matrix4x4 o_mat)
 {
     ToCameraFrustumRH(i_arparam.getPerspectiveProjectionMatrix(), i_arparam.getScreenSize(), i_scale, i_near, i_far, ref o_mat);
       return;
 }
 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 = new NyARBinRaster(s.w, s.h);
 }
 public DetectSquare(NyARParam i_param)
     : base(i_param.getScreenSize())
 {
     this._match_patt = null;
     this._coordline = new NyARCoord2Linear(i_param.getScreenSize(), i_param.getDistortionFactor());
     return;
 }
        /**
         * この関数は、インスタンスを初期化します。
         * 継承先のクラスから呼び出してください。
         * @param i_param
         * カメラパラメータオブジェクト。このサイズは、{@link #detectMarker}に入力する画像と同じサイズである必要があります。
         * @
         */
        protected void initInstance(NyARParam i_param)
        {
            //初期化済?
              Debug.Assert(this._initialized == false);

              NyARIntSize scr_size = i_param.getScreenSize();
              // 解析オブジェクトを作る
              this._transmat = new NyARTransMat(i_param);
              this._thdetect = new NyARHistogramAnalyzer_SlidePTile(15);

              // 2値画像バッファを作る
              this._gs_raster = new NyARGrayscaleRaster(scr_size.w, scr_size.h);
              this._initialized = true;
              //コールバックハンドラ
              this._detectmarker = new DetectSquare(i_param);
              this._offset = new NyARRectOffset();
              return;
        }
 public RleDetector(NyARParam i_param, INyIdMarkerDataEncoder i_encoder, NyIdMarkerPickup i_id_pickup)
     : base(i_param.getScreenSize())
 {
     this._coordline = new NyARCoord2Linear(i_param.getScreenSize(), i_param.getDistortionFactor());
     this._data_temp = i_encoder.CreateDataInstance();
     this._current_data = i_encoder.CreateDataInstance();
     this._encoder = i_encoder;
     this._id_pickup = i_id_pickup;
     return;
 }
        /**
         * この関数は、インスタンスを初期化します。
         * 継承先のクラスから呼び出してください。
         * @param i_param
         * カメラパラメータオブジェクト。このサイズは、{@link #detectMarker}に入力する画像と同じサイズである必要があります。
         * @param i_encoder
         * IDマーカの値エンコーダを指定します。
         * @param i_marker_width
         * マーカの物理縦横サイズをmm単位で指定します。
         * @
         */
        protected void InitInstance(NyARParam i_param, INyIdMarkerDataEncoder i_encoder, double i_marker_width)
        {
            //初期化済?
              Debug.Assert(this._initialized == false);

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

              // 2値画像バッファを作る
              this._gs_raster = new NyARGrayscaleRaster(scr_size.w, scr_size.h);
              this._histmaker = (INyARHistogramFromRaster)this._gs_raster.createInterface(typeof(INyARHistogramFromRaster));
              //ワーク用のデータオブジェクトを2個作る
              this._data_current = i_encoder.CreateDataInstance();
              this._threshold_detect = new NyARHistogramAnalyzer_SlidePTile(15);
              this._initialized = true;
              this._is_active = false;
              this._offset = new NyARRectOffset();
              this._offset.setSquare(i_marker_width);
              return;
        }
Esempio n. 8
0
 /**
  * コンストラクタ。
  * 樽型歪みが少ない、または補正済みの画像を入力するときには、{@link #NyARReality(NyARIntSize, double, double, NyARPerspectiveProjectionMatrix, NyARCameraDistortionFactor, int, int)}
  * のi_dist_factorにnullを指定すると、より高速な動作が期待できます。
  * @param i_param
  * カメラパラメータを指定します。
  * @param i_near
  * 視錐体のnear-pointをmm単位で指定します。
  * default値は{@link #FRASTRAM_ARTK_NEAR}です。
  * @param i_far
  * 視錐体のfar-pointをmm単位で指定します。
  * default値は{@link #FRASTRAM_ARTK_FAR}です。
  * @param i_max_known_target
  * Knownターゲットの最大数を指定します。
  * @param i_max_unknown_target
  * UnKnownターゲットの最大数を指定します。
  * @throws NyARException
  */
 public NyARReality(NyARParam i_param, double i_near, double i_far, int i_max_known_target, int i_max_unknown_target)
 {
     //定数とかいろいろ
       this.MAX_LIMIT_KNOWN = i_max_known_target;
       this.MAX_LIMIT_UNKNOWN = i_max_unknown_target;
       this.InitInstance(i_param.getScreenSize(), i_near, i_far, i_param.getPerspectiveProjectionMatrix(), i_param.getDistortionFactor());
       return;
 }