Beispiel #1
0
        /**
         * Trackerの状態を更新します。
         * @param i_source
         * @throws NyARException
         */
        public void progress(NyARTrackerSource i_s)
        {
            //SampleOutを回収
            LowResolutionLabelingSamplerOut sample_out = i_s.makeSampleOut();

            NyARTargetList[] targets = this._temp_targets;
            NyARTargetList   newtr   = targets[NyARTargetStatus.ST_NEW];
            NyARTargetList   igtr    = targets[NyARTargetStatus.ST_IGNORE];
            NyARTargetList   cotr    = targets[NyARTargetStatus.ST_CONTURE];
            NyARTargetList   retw    = targets[NyARTargetStatus.ST_RECT];

            INyARVectorReader vecreader = i_s.getBaseVectorReader();

            //ターゲットリストの振り分け
            NyARTarget[] target_array = this._targets.getArray();
            newtr.clear();
            igtr.clear();
            cotr.clear();
            retw.clear();
            for (int i = this._targets.getLength() - 1; i >= 0; i--)
            {
                targets[target_array[i]._st_type].pushAssert(target_array[i]);
            }
            int[] index = this._index;
            //サンプルをターゲット毎に振り分け
            sampleMapper(sample_out, newtr, igtr, cotr, retw, this._newsource, this._igsource, this._coordsource, this._rectsource);

            //ターゲットの更新
            this._map.makePairIndexes(this._igsource, igtr, index);
            updateIgnoreStatus(igtr, this._igsource.getArray(), index);

            this._map.makePairIndexes(this._newsource, newtr, index);
            updateNewStatus(newtr, this.newst_pool, this._newsource.getArray(), index);

            this._map.makePairIndexes(this._rectsource, retw, index);
            updateRectStatus(retw, vecreader, this.rect_pool, this._rectsource.getArray(), index);

            this._map.makePairIndexes(this._coordsource, cotr, index);
            updateContureStatus(cotr, vecreader, this.contourst_pool, this._coordsource.getArray(), index);

            //ターゲットのアップグレード
            for (int i = this._targets.getLength() - 1; i >= 0; i--)
            {
                switch (target_array[i]._st_type)
                {
                case NyARTargetStatus.ST_IGNORE:
                    upgradeIgnoreTarget(i);
                    continue;

                case NyARTargetStatus.ST_NEW:
                    upgradeNewTarget(target_array[i], vecreader);
                    continue;

                case NyARTargetStatus.ST_RECT:
                    upgradeRectTarget(target_array[i]);
                    continue;

                case NyARTargetStatus.ST_CONTURE:
                    upgradeContourTarget(target_array[i]);
                    continue;
                }
            }
            return;
        }