Beispiel #1
0
        /**
         * コンストラクタです。
         * @param i_max_new
         * Newトラックターゲットの最大数を指定します。
         * @param i_max_cont
         * Contourトラックターゲットの最大数を指定します。
         * @param i_max_rect
         * Rectトラックターゲットの最大数を指定します。
         * @throws NyARException
         */
        public NyARTracker(int i_max_new, int i_max_cont, int i_max_rect)
        {
            //環境定数の設定
            this.MAX_NUMBER_OF_NEW     = i_max_new;
            this.MAX_NUMBER_OF_CONTURE = i_max_cont;
            this.MAX_NUMBER_OF_RECT    = i_max_rect;
            this.MAX_NUMBER_OF_TARGET  = (i_max_new + i_max_cont + i_max_rect) * 5;


            //ターゲットマップ用の配列と、リスト。この関数はNyARTargetStatusのIDと絡んでるので、気をつけて!
            this._temp_targets = new NyARTargetList[NyARTargetStatus.MAX_OF_ST_KIND + 1];
            this._temp_targets[NyARTargetStatus.ST_NEW]     = new NyARTargetList(i_max_new);
            this._temp_targets[NyARTargetStatus.ST_IGNORE]  = new NyARTargetList(this.MAX_NUMBER_OF_TARGET);
            this._temp_targets[NyARTargetStatus.ST_CONTURE] = new NyARTargetList(i_max_cont);
            this._temp_targets[NyARTargetStatus.ST_RECT]    = new NyARRectTargetList(i_max_rect);

            //ソースリスト
            this._newsource   = new SampleStack(i_max_new);
            this._igsource    = new SampleStack(this.MAX_NUMBER_OF_TARGET);
            this._coordsource = new SampleStack(i_max_cont);
            this._rectsource  = new SampleStack(i_max_rect);

            //ステータスプール
            this.newst_pool     = new NyARNewTargetStatusPool(i_max_new * 2);
            this.contourst_pool = new NyARContourTargetStatusPool(i_max_rect + i_max_cont * 2);
            this.rect_pool      = new NyARRectTargetStatusPool(i_max_rect * 2);
            //ターゲットプール
            this.target_pool = new NyARTargetPool(this.MAX_NUMBER_OF_TARGET);
            //ターゲット
            this._targets = new NyARTargetList(this.MAX_NUMBER_OF_TARGET);

            //ここ注意!マップの最大値は、ソースアイテムの個数よりおおきいこと!
            this._map   = new DistMap(this.MAX_NUMBER_OF_TARGET, this.MAX_NUMBER_OF_TARGET);
            this._index = new int[this.MAX_NUMBER_OF_TARGET];

            //定数初期化
            this._number_of_new = this._number_of_ignore = this._number_of_contoure = this._number_of_rect = 0;
        }
Beispiel #2
0
        //
        //制御部

        /**
         * @Override
         */
        public NyARRectTargetStatus(NyARRectTargetStatusPool i_pool)
            : base(i_pool._op_interface)
        {
            this._ref_my_pool = i_pool;
            this.detect_type  = DT_SQINIT;
        }
Beispiel #3
0
        public static void updateRectStatus(NyARTargetList i_list, INyARVectorReader i_vecreader, NyARRectTargetStatusPool i_stpool, LowResolutionLabelingSamplerOut.Item[] source, int[] index)
        {
            NyARTarget[] rct = i_list.getArray();
            NyARTarget   d_ptr;

            //ターゲットの更新
            for (int i = i_list.getLength() - 1; i >= 0; i--)
            {
                d_ptr = rct[i];
                //年齢を加算
                d_ptr._status_life--;
                //新しいステータスの作成
                NyARRectTargetStatus st = i_stpool.newObject();
                if (st == null)
                {
                    //失敗(作れなかった?)
                    d_ptr._delay_tick++;
                    continue;
                }
                int sample_index = index[i];
                LowResolutionLabelingSamplerOut.Item s = sample_index < 0?null:source[sample_index];
                if (!st.setValueByAutoSelect(i_vecreader, s, (NyARRectTargetStatus)d_ptr._ref_status))
                {
                    st.releaseObject();
                    d_ptr._delay_tick++;
                    continue;
                }
                else
                {
                    if (s != null)
                    {
                        d_ptr.setSampleArea(s);
                    }
                }
                d_ptr._ref_status.releaseObject();
                d_ptr._ref_status = st;
                d_ptr._delay_tick = 0;
            }
        }