Changeset 17558 for lang/actionscript/ashaardetect/trunk/cv/HaarCascade.mas
- Timestamp:
- 08/13/08 00:51:51 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/ashaardetect/trunk/cv/HaarCascade.mas
r17274 r17558 21 21 private var mSpecificityList:Array; 22 22 23 private var mSourceWindow:IntRect = null; 24 23 25 #define SPL_STEP 10 24 26 … … 36 38 { 37 39 return mSpecificityList; 40 } 41 42 public function setSourceWindow(x:int, y:int, w:int, h:int):void 43 { 44 if (!mSourceWindow) 45 mSourceWindow = new IntRect(); 46 47 mSourceWindow.x = x; 48 mSourceWindow.y = y; 49 mSourceWindow.w = w; 50 mSourceWindow.h = h; 38 51 } 39 52 … … 101 114 mYieldContext.res = null; 102 115 mYieldContext.factor = 1; 103 mYieldContext.sumimage = new SumImage(bmp); 116 if (mSourceWindow) 117 mYieldContext.sumimage = new SumImage(bmp, true, mSourceWindow.y, mSourceWindow.h); 118 else 119 mYieldContext.sumimage = new SumImage(bmp, true); 120 104 121 mYieldContext.Hsumimage = null; 105 122 mYieldContext.mask_index = 1; … … 115 132 var pass:uint = 0; 116 133 134 var ox:int = 0; 135 var oy:int = 0; 136 117 137 mSumRaw = sums.raw; 118 138 mSumW = sums.width; … … 120 140 var srcWidth:uint = bmp.width; 121 141 var srcHeight:uint = bmp.height; 142 143 if (mSourceWindow) { 144 srcWidth = mSourceWindow.w; 145 srcHeight = mSourceWindow.h; 146 ox = mSourceWindow.x; 147 oy = mSourceWindow.y; 148 } 149 122 150 var winWidth:uint; 123 151 var winHeight:uint; … … 131 159 132 160 for( ; factor*Number(width) < (srcWidth - 10) && 133 factor*Number(height) < (srcHeight - 10);161 factor*Number(height) < (srcHeight - 20); 134 162 factor *= scale_factor, ++mask_index ) 135 163 { … … 177 205 178 206 var _ix:uint, _xstep:uint = 1; 179 iy = cvRound(_iy*ystep) ;207 iy = cvRound(_iy*ystep) + oy; 180 208 iyp = iy * mSumW; 181 209 … … 183 211 for( _ix = 0; _ix < stop_width; _ix += _xstep ) 184 212 { 185 var ix:int = _ix*ystep ; // it really should be ystep213 var ix:int = _ix*ystep + ox; // it really should be ystep 186 214 187 215 if(pass == 0) … … 389 417 public var Hsumimage:SumImage; 390 418 } 419 420 class IntRect 421 { 422 public var x:int, y:int, w:int, h:int; 423 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)