チェンジセット 1597

差分発生行の前後
無視リスト:
コミット日時:
2008/10/13 01:28:11 (3 ヶ月前)
コミッタ:
saqoosha
ログメッセージ:

入力画像がモノクロに変換されちゃうのを修正。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/FLARToolKit/branches/2.0/samples/net/saqoosha/flartoolkit/example/PV3DARApp.as

    r1596 r1597  
    5959                        this._renderer = new LazyRenderEngine(this._scene, this._camera3d, this._viewport); 
    6060                         
    61 //                    this.stage.addChild(new StatsView(this._renderer)); 
     61                      this.stage.addChild(new StatsView(this._renderer)); 
    6262                         
    6363                        this.addEventListener(Event.ENTER_FRAME, this._onEnterFrame); 
     
    6666                private function _onEnterFrame(e:Event = null):void { 
    6767                        this._capture.bitmapData.draw(this._video); 
    68                         if (this._detector.detectMarkerLite(this._raster, 80) && this._detector.getConfidence() > 0.5) { 
     68                        if (this._detector.detectMarkerLite(this._raster, 80)) {// && this._detector.getConfidence() > 0.5) { 
    6969                                this._detector.getTransformMatrix(this._resultMat); 
    7070                                this._baseNode.setTransformMatrix(this._resultMat); 
  • as3/FLARToolKit/branches/2.0/src/org/libspark/flartoolkit/core/rasterfilter/rgb2bin/FLARRasterFilter_BitmapDataThreshold.as

    r1595 r1597  
    5353                 
    5454                private var _threshold:int; 
     55                private var _tmp:BitmapData; 
    5556                 
    5657                public function FLARRasterFilter_BitmapDataThreshold(i_threshold:int) { 
     
    6465                public function doFilter(i_input:IFLARRgbRaster, i_output:IFLARRaster):void { 
    6566                        var inbmp:BitmapData = FLARRgbRaster_BitmapData(i_input).bitmapData; 
    66                         inbmp.applyFilter(inbmp, inbmp.rect, ZERO_POINT, MONO_FILTER); 
     67                        if (!this._tmp) { 
     68                                this._tmp = new BitmapData(inbmp.width, inbmp.height, false, 0x0); 
     69                        } else if (inbmp.width != this._tmp.width || inbmp.height != this._tmp.height) { 
     70                                this._tmp.dispose(); 
     71                                this._tmp = new BitmapData(inbmp.width, inbmp.height, false, 0x0); 
     72                        } 
     73                        this._tmp.applyFilter(inbmp, inbmp.rect, ZERO_POINT, MONO_FILTER); 
    6774                        var outbmp:BitmapData = FLARRaster_BitmapData(i_output).bitmapData; 
    6875                        outbmp.fillRect(outbmp.rect, 0x0); 
    6976                        var rect:Rectangle = outbmp.rect; 
    7077                        rect.inflate(-1, -1); 
    71                         outbmp.threshold(inbmp, rect, ONE_POINT, '<=', this._threshold, 0xffffffff, 0xff); 
     78                        outbmp.threshold(this._tmp, rect, ONE_POINT, '<=', this._threshold, 0xffffffff, 0xff); 
    7279                } 
    7380        }