チェンジセット 1727

差分発生行の前後
無視リスト:
コミット日時:
2008/10/28 03:22:35 (2 ヶ月前)
コミッタ:
tarotarorg
ログメッセージ:

複数マーカの検出を可能にした
サイズチェックはコメントアウトしてある

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/detector/FLARDetectMarker.as

    r1640 r1727  
    3030 
    3131package org.libspark.flartoolkit.detector { 
     32        import org.libspark.flartoolkit.core.raster.FLARRaster_BitmapData; 
     33        import org.libspark.flartoolkit.core.raster.IFLARRaster; 
     34        import org.libspark.flartoolkit.core.rasterfilter.rgb2bin.FLARRasterFilter_BitmapDataThreshold; 
    3235        import org.libspark.flartoolkit.FLARException; 
    3336        import org.libspark.flartoolkit.core.FLARSquare; 
     
    114117                        this._match_patt = new FLARMatchPatt_Color_WITHOUT_PCA(); 
    115118                        //2値画像バッファを作る 
    116                         this._bin_raster = new FLARBinRaster(scr_size.w, scr_size.h);            
    117                 } 
    118  
    119                 private var _bin_raster:FLARBinRaster; 
    120  
    121                 private var _tobin_filter:FLARRasterFilter_ARToolkitThreshold = new FLARRasterFilter_ARToolkitThreshold(100); 
     119//                      this._bin_raster = new FLARBinRaster(scr_size.w, scr_size.h); 
     120                        this._bin_raster = new FLARRaster_BitmapData(scr_size.w, scr_size.h); 
     121                } 
     122 
     123                private var _bin_raster:IFLARRaster; 
     124 
     125//              private var _tobin_filter:FLARRasterFilter_ARToolkitThreshold = new FLARRasterFilter_ARToolkitThreshold(100); 
     126                private var _tobin_filter:FLARRasterFilter_BitmapDataThreshold = new FLARRasterFilter_BitmapDataThreshold(100); 
    122127 
    123128                /** 
     
    133138                public function detectMarkerLite(i_raster:IFLARRgbRaster, i_threshold:int):int { 
    134139                        // サイズチェック 
    135                         if (!this._bin_raster.getSize().isEqualSizeO(i_raster.getSize())) { 
    136                                 throw new FLARException(); 
    137                         } 
     140                        //trace(this._bin_raster.getSize().w, i_raster.getSize().w); 
     141                        //if (!this._bin_raster.getSize().isEqualSizeO(i_raster.getSize())) { 
     142                                //throw new FLARException(); 
     143                        //} 
    138144 
    139145                        // ラスタを2値イメージに変換する. 
     
    192198                                } 
    193199                                // i番目のパターン情報を保存する。 
    194                                 const result:FLARDetectMarkerResult = this._result_holder.result_array[i]; 
     200                                var result:FLARDetectMarkerResult = this._result_holder.result_array[i]; 
    195201                                result.arcode_id = code_index; 
    196202                                result.confidence = confidence; 
     
    221227                } 
    222228 
     229                public function getResult(i_index:int):Object 
     230                { 
     231                        const result:FLARDetectMarkerResult = this._result_holder.result_array[i_index]; 
     232                        var ret:Object = new Object(); 
     233                        ret.square = result.ref_square; 
     234                        ret.codeId = result.arcode_id; 
     235                        ret.confidence = result.confidence; 
     236                        return ret; 
     237                } 
    223238                /** 
    224239                 * i_indexのマーカーの一致度を返します。