チェンジセット 1727
- コミット日時:
- 2008/10/28 03:22:35 (2 ヶ月前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/detector/FLARDetectMarker.as
r1640 r1727 30 30 31 31 package 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; 32 35 import org.libspark.flartoolkit.FLARException; 33 36 import org.libspark.flartoolkit.core.FLARSquare; … … 114 117 this._match_patt = new FLARMatchPatt_Color_WITHOUT_PCA(); 115 118 //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); 122 127 123 128 /** … … 133 138 public function detectMarkerLite(i_raster:IFLARRgbRaster, i_threshold:int):int { 134 139 // サイズチェック 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 //} 138 144 139 145 // ラスタを2値イメージに変換する. … … 192 198 } 193 199 // i番目のパターン情報を保存する。 194 constresult:FLARDetectMarkerResult = this._result_holder.result_array[i];200 var result:FLARDetectMarkerResult = this._result_holder.result_array[i]; 195 201 result.arcode_id = code_index; 196 202 result.confidence = confidence; … … 221 227 } 222 228 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 } 223 238 /** 224 239 * i_indexのマーカーの一致度を返します。
