コード例 #1
0
 /**
  * コンストラクタです。カメラパラメータにサンプル値(../Data/camera_para.dat)をロードして、コンフィギュレーションを生成します。
  * @param i_width
  * @param i_height
  * @
  */
 public NyARMarkerSystemConfig(NyARParam i_param, int i_transmat_algo_type)
 {
     Debug.Assert(1 <= i_transmat_algo_type && i_transmat_algo_type <= 3);
       this._param = i_param;
       this._transmat_algo_type = i_transmat_algo_type;
       return;
 }
コード例 #2
0
 public static NyARSingleDetectMarker createInstance(NyARParam i_param, NyARCode i_code, double i_marker_width)
 {
     return createInstance(i_param, i_code, i_marker_width, PF_NYARTOOLKIT);
 }
コード例 #3
0
 /**
  * 処理プロファイルを指定して、{@link NyARSingleDetectoMarker}オブジェクトを生成します。
  * @param i_param
  * カメラパラメータを指定します。このサイズは、{@link #detectMarkerLite}に入力する画像と同じである必要があります。
  * @param i_code
  * 検出するマーカパターンを指定します。
  * @param i_marker_width
  * 正方形マーカの物理サイズをmm単位で指定します。
  * @param i_input_raster_type
  * {@link #detectMarkerLite}に入力するラスタの画素形式を指定します。
  * この値は、{@link INyARRgbRaster#getBufferType}関数の戻り値を利用します。
  * @param i_profile_id
  * 計算アルゴリズムの選択値です。以下の定数のいずれかを指定します。
  * <ul>
  * <li>{@link #PF_ARTOOLKIT_COMPATIBLE}
  * <li>{@link #PF_NYARTOOLKIT}
  * <li>{@link #PF_NYARTOOLKIT_ARTOOLKIT_FITTING}
  * </ul>
  * @
  * @
  */
 public static NyARSingleDetectMarker createInstance(NyARParam i_param, NyARCode i_code, double i_marker_width, int i_profile_id)
 {
     switch (i_profile_id) {
     case PF_ARTOOLKIT_COMPATIBLE:
       return new NyARSingleDetectMarker_ARTKv2(i_param, i_code, i_marker_width);
     case PF_NYARTOOLKIT_ARTOOLKIT_FITTING:
       return new NyARSingleDetectMarker_NyARTK_FITTING_ARTKv2(i_param, i_code, i_marker_width);
     case PF_NYARTOOLKIT://default
       return new NyARSingleDetectMarker_NyARTK(i_param, i_code, i_marker_width);
     default:
       throw new NyARException();
       }
 }
コード例 #4
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 = new NyARBinRaster(s.w, s.h);
 }
コード例 #5
0
ファイル: NyARIcpPlane.cs プロジェクト: ooHIROoo/Imagine2016
 public NyARIcpPlane(NyARParam i_param)
 {
     this._cparam = i_param.getPerspectiveProjectionMatrix();
 }
コード例 #6
0
 /**
  * コンストラクタです。
  * 座標計算に必要なカメラパラメータの参照値を元に、インスタンスを生成します。
  * @param i_param
  * ARToolKit形式のカメラパラメータです。
  * インスタンスは、この中から樽型歪み矯正オブジェクト、射影変換オブジェクトを参照します。
  * @
  */
 public NyARTransMat(NyARParam i_param)
     : this(i_param.getDistortionFactor(), i_param.getPerspectiveProjectionMatrix())
 {
     return;
 }
コード例 #7
0
 /**
  * @param i_param
  * @param i_max_points
  * 最大頂点数
  * @throws NyARException
  */
 public NyARIcpPointRobust(NyARParam i_param)
     : base(i_param)
 {
 }
コード例 #8
0
 public NyARMarkerSystemConfig(NyARParam i_param)
     : this(i_param, TM_ARTKICP)
 {
 }
コード例 #9
0
ファイル: NyARTransMat.cs プロジェクト: ooHIROoo/Imagine2016
 /**
  * コンストラクタです。
  * 座標計算に必要なカメラパラメータの参照値を元に、インスタンスを生成します。
  * @param i_param
  * ARToolKit形式のカメラパラメータです。
  * インスタンスは、この中から樽型歪み矯正オブジェクト、射影変換オブジェクトを参照します。
  * @
  */
 public NyARTransMat(NyARParam i_param)
     : this(i_param.getDistortionFactor(), i_param.getPerspectiveProjectionMatrix())
 {
     return;
 }
コード例 #10
0
 /**
  * @param i_param
  * @param i_max_points
  * 最大頂点数
  * @throws NyARException
  */
 public NyARIcpPointRobust(NyARParam i_param)
     : base(i_param)
 {
 }
コード例 #11
0
 public DetectSquare(NyARParam i_param)
     : base(i_param.getScreenSize())
 {
     this._match_patt = null;
     this._coordline = new NyARCoord2Linear(i_param.getScreenSize(), i_param.getDistortionFactor());
     return;
 }
コード例 #12
0
        /**
         * この関数は、インスタンスを初期化します。
         * 継承先のクラスから呼び出してください。
         * @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;
        }
コード例 #13
0
 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;
 }
コード例 #14
0
        /**
         * この関数は、インスタンスを初期化します。
         * 継承先のクラスから呼び出してください。
         * @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;
        }
コード例 #15
0
ファイル: NyARReality.cs プロジェクト: ooHIROoo/Imagine2016
 /**
  * コンストラクタ。
  * 樽型歪みが少ない、または補正済みの画像を入力するときには、{@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;
 }
コード例 #16
0
 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());
 }
コード例 #17
0
 public NyARIcpPlane(NyARParam i_param)
 {
     this._cparam = i_param.getPerspectiveProjectionMatrix();
 }
コード例 #18
0
ファイル: NyARUnityUtil.cs プロジェクト: ooHIROoo/Imagine2016
 /**
  * この関数は、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;
 }