Exemple #1
0
        /**
         * NyARTrackerOutのCOntourTargetについて、アップグレード処理をします。
         * アップグレードの種類は以下のにとおりです。1.一定期間経過後の破棄ルート(Ignoreへ遷移)2.正常認識ルート(Rectへ遷移)
         * @param i_base_raster
         * @param i_trackdata
         * @throws NyARException
         */
        private void upgradeContourTarget(NyARTarget i_contoure_target)
        {
            Debug.Assert(i_contoure_target._st_type == NyARTargetStatus.ST_CONTURE);
            if (i_contoure_target._status_life <= 0)
            {
                //一定の期間が経過したら、ignoreへ遷移
                this.changeStatusToIgnore(i_contoure_target, LIFE_OF_IGNORE_FROM_CONTOUR);
                return;
            }
            if (i_contoure_target._delay_tick > 20)
            {
                this.changeStatusToIgnore(i_contoure_target, LIFE_OF_IGNORE_FROM_CONTOUR);
                return;
                //一定の期間updateができなければ、ignoreへ遷移
            }

            NyARContourTargetStatus st = (NyARContourTargetStatus)i_contoure_target._ref_status;
            //coordステータスを生成
            NyARRectTargetStatus c = this.rect_pool.newObject();

            if (c == null)
            {
                //ターゲットがいっぱい。
                return;
            }
            //ステータスの値をセット
            if (!c.setValueWithInitialCheck(st, i_contoure_target._sample_area))
            {
                //値のセットに失敗した。
                c.releaseObject();
                return;
            }
            if (this.changeStatusToRect(i_contoure_target, c) == null)
            {
                //ターゲットいっぱい?
                c.releaseObject();
                return;
            }
            return;
        }
Exemple #2
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;
            }
        }