Changeset 13940 for trunk/Mars
- Timestamp:
- 05/27/12 16:39:51 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/DrsCalib.h
r12967 r13940 343 343 } 344 344 345 static voidGetPixelStats(float *ptr, const float *data, uint16_t roi)345 static double GetPixelStats(float *ptr, const float *data, uint16_t roi) 346 346 { 347 347 if (roi==0) 348 return; 349 348 return -1; 349 350 const int beg = roi>10 ? 10 : 0; 351 352 double max = 0; 350 353 for (int i=0; i<1440; i++) 351 354 { 352 355 const float *vec = data+i*roi; 353 356 354 int pos = 0;355 double sum = vec[ 0];356 double sum2 = vec[ 0]*vec[0];357 for (int j= 1; j<roi; j++)357 int pos = beg; 358 double sum = vec[beg]; 359 double sum2 = vec[beg]*vec[beg]; 360 for (int j=beg; j<roi; j++) 358 361 { 359 362 sum += vec[j]; … … 363 366 pos = j; 364 367 } 365 sum /= roi; 366 sum2 /= roi; 368 sum /= roi-beg; 369 sum2 /= roi-beg; 370 371 if (vec[pos]>0) 372 max = vec[pos]; 367 373 368 374 *(ptr+0*1440+i) = sum; … … 371 377 *(ptr+3*1440+i) = pos; 372 378 } 379 380 return max; 373 381 } 374 382
Note:
See TracChangeset
for help on using the changeset viewer.