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); //パターンの一致検索処理用 this._inst_patt = i_patt_inst; this._deviation_data = new NyARMatchPattDeviationColorData(i_ref_code.getWidth(), i_ref_code.getHeight()); this._coordline = new NyARCoord2Linear(i_ref_param.getScreenSize(), i_ref_param.getDistortionFactor()); this._match_patt = new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code); //オフセットを作成 this._offset = new NyARRectOffset(); this._offset.setSquare(i_marker_width); return; }
public DetectSquare(NyARParam i_param, int i_raster_type) : base(i_param.getScreenSize()) { this._match_patt = null; this._coordline = new NyARCoord2Linear(i_param.getScreenSize(), i_param.getDistortionFactor()); this._raster_type = i_raster_type; return; }
public DetectSquareCB(INyARColorPatt i_inst_patt, NyARCode i_ref_code, NyARParam i_param) { this._inst_patt = i_inst_patt; this._deviation_data = new NyARMatchPattDeviationColorData(i_ref_code.getWidth(), i_ref_code.getHeight()); this._coordline = new Coord2Linear(i_param.getScreenSize(), i_param.getDistortionFactor()); this._match_patt = new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code); return; }
public DetectSquareCB(NyARParam i_param, INyIdMarkerDataEncoder i_encoder) { this._coordline = new Coord2Linear(i_param.getScreenSize(), i_param.getDistortionFactor()); this._data_temp = i_encoder.createDataInstance(); this._current_data = i_encoder.createDataInstance(); this._encoder = i_encoder; 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; }
public NyARTransMat_ARToolKit(NyARParam i_param) { NyARCameraDistortionFactor dist = i_param.getDistortionFactor(); NyARPerspectiveProjectionMatrix pmat = i_param.getPerspectiveProjectionMatrix(); this._transsolver = new NyARTransportVectorSolver_ARToolKit(pmat); //互換性が重要な時は、NyARRotMatrix_ARToolKitを使うこと。 //理屈はNyARRotMatrix_NyARToolKitもNyARRotMatrix_ARToolKitも同じだけど、少しだけ値がずれる。 this._rotmatrix = new NyARRotMatrix_ARToolKit_O2(pmat); this._mat_optimize = new NyARRotMatrixOptimize_O2(pmat); this._ref_dist_factor = dist; }
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 OnSquareDetect( NyARParam i_params, ARMarkerList i_armk_list, NyIdList i_idmk_list, ARPlayCardList i_psmk_list, TrackingList i_tracking_list, int i_initial_stack_size) { this._coordline = new NyARCoord2Linear(i_params.getScreenSize(), i_params.getDistortionFactor()); this._ref_armk_list = i_armk_list; this._ref_idmk_list = i_idmk_list; this._ref_psmk_list = i_psmk_list; this._ref_tracking_list = i_tracking_list; this._sq_stack = new SquareStack(i_initial_stack_size); }
public RleDetector(INyARColorPatt i_inst_patt, NyARCode[] i_ref_code, int i_num_of_code, NyARParam i_param) : base(i_param.getScreenSize()) { int cw = i_ref_code[0].getWidth(); int ch = i_ref_code[0].getHeight(); //NyARMatchPatt_Color_WITHOUT_PCA[]の作成 this._match_patt = new NyARMatchPatt_Color_WITHOUT_PCA[i_num_of_code]; this._match_patt[0] = new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code[0]); for (int i = 1; i < i_num_of_code; i++) { //解像度チェック if (cw != i_ref_code[i].getWidth() || ch != i_ref_code[i].getHeight()) { throw new NyARException(); } this._match_patt[i] = new NyARMatchPatt_Color_WITHOUT_PCA(i_ref_code[i]); } this._inst_patt = i_inst_patt; this._coordline = new NyARCoord2Linear(i_param.getScreenSize(), i_param.getDistortionFactor()); this._deviation_data = new NyARMatchPattDeviationColorData(cw, ch); return; }
/** * コンストラクタです。 * 座標計算に必要なカメラパラメータの参照値を元に、インスタンスを生成します。 * @param i_param * ARToolKit形式のカメラパラメータです。 * インスタンスは、この中から樽型歪み矯正オブジェクト、射影変換オブジェクトを参照します。 * @ */ public NyARTransMat_ARToolKit(NyARParam i_param) : this(i_param.getDistortionFactor(), i_param.getPerspectiveProjectionMatrix()) { }
/// <summary> /// Initialize a new SquareDetectionListener. /// </summary> /// <param name="patternMatchers">The pattern matchers with the marker data.</param> /// <param name="cameraParameters">The camera calibration data.</param> /// <param name="colorPattern">The used color pattern.</param> /// <param name="patternMatchDeviationData">The pattern match deviation data.</param> public SquareDetectionListener(List <PatternMatcher> patternMatchers, NyARParam cameraParameters, INyARColorPatt colorPattern, NyARMatchPattDeviationColorData patternMatchDeviationData) { this.patternMatchers = patternMatchers; this.colorPattern = colorPattern; this.patternMatchDeviationData = patternMatchDeviationData; this.coordinationMapper = new Coord2Linear(cameraParameters.getScreenSize(), cameraParameters.getDistortionFactor()); this.matrixCalculator = new NyARTransMat(cameraParameters); this.points = NyARIntPoint2d.createArray(4); this.evaluationResult = new NyARMatchPattResult(); Reset(); }
/** * コンストラクタです。 * 座標計算に必要なカメラパラメータの参照値を元に、インスタンスを生成します。 * @param i_param * ARToolKit形式のカメラパラメータです。 * インスタンスは、この中から樽型歪み矯正オブジェクト、射影変換オブジェクトを参照します。 * @ */ public NyARTransMat_ARToolKit(NyARParam i_param) { initInstance(i_param.getDistortionFactor(), i_param.getPerspectiveProjectionMatrix()); }
/** * コンストラクタ。 * 樽型歪みが少ない、または補正済みの画像を入力するときには、{@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; }
public DetectSquareCB(NyARParam i_param) { this._match_patt = null; this._coordline = new Coord2Linear(i_param.getScreenSize(), i_param.getDistortionFactor()); return; }
public NyARTransMat_ARToolKit(NyARParam i_param) { initInstance(i_param.getDistortionFactor(), i_param.getPerspectiveProjectionMatrix()); }