Example #1
0
 public void finish()
 {
     //一致率の最も高いアイテムを得る。
     ARMarkerSortList.Item top_item = this._mkmap.getTopItem();
     //アイテムを検出できなくなるまで、一致率が高い順にアイテムを得る。
     while (top_item != null)
     {
         //検出したアイテムのARmarkerIndexのデータをセット
         ARMarkerList.Item target = top_item.marker;
         if (target.lost_count > 0)
         {
             //未割当のマーカのみ検出操作を実行。
             target.cf         = top_item.cf;
             target.lost_count = 0; //消失カウンタをリセット
             target.life++;         //ライフ値を加算
             target.sq = top_item.ref_sq;
             target.sq.rotateVertexL(4 - top_item.dir);
             NyARIntPoint2d.shiftCopy(top_item.ref_sq.ob_vertex, target.tl_vertex, 4 - top_item.dir);
             target.tl_center.setValue(top_item.ref_sq.center2d);
             target.tl_rect_area = top_item.ref_sq.rect_area;
         }
         //基準アイテムと重複するアイテムを削除する。
         this._mkmap.disableMatchItem(top_item);
         top_item = this._mkmap.getTopItem();
     }
     //消失カウンタが敷居値を越えたら、lifeを0にする。
 }
Example #2
0
        /**
         * o_targetsに、敷居値を越えたターゲットリストを返却する。
         * @param i_pix_drv
         * @param i_vertex
         * @param o_targets
         * @return
         * @
         */
        public bool update(INyARPerspectiveCopy i_pix_drv, SquareStack.Item i_sq)
        {
            //sq_tmpに値を生成したかのフラグ
            bool is_ganalated_sq = false;

            for (int i = this.Count - 1; i >= 0; i--)
            {
                ARMarkerList.Item target = this[i];
                //解像度に一致する画像を取得
                NyARMatchPattDeviationColorData diff = this._mpickup.getDeviationColorData(target, i_pix_drv, i_sq.ob_vertex);
                //マーカのパターン解像度に一致したサンプリング画像と比較する。
                if (!target.matchpatt.evaluate(diff, this._patt_result))
                {
                    continue;
                }
                //敷居値をチェック
                if (this._patt_result.confidence < this._configense_th)
                {
                    continue;
                }
                //マーカマップへの追加対象か調べる。
                ARMarkerSortList.Item ip = this._mkmap.getInsertPoint(this._patt_result.confidence);
                if (ip == null)
                {
                    continue;
                }
                //マーカマップアイテムの矩形に参照値を設定する。
                ip              = this._mkmap.insertFromTailBefore(ip);
                ip.cf           = this._patt_result.confidence;
                ip.dir          = this._patt_result.direction;
                ip.marker       = target;
                ip.ref_sq       = i_sq;
                is_ganalated_sq = true;
            }
            return(is_ganalated_sq);
        }