Changeset 17400 for trunk/Mars/mcore
- Timestamp:
- 11/29/13 13:00:29 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/DrsCalib.h
r17336 r17400 857 857 } 858 858 859 static double GetPixelStats(float *ptr, const float *data, uint16_t roi )859 static double GetPixelStats(float *ptr, const float *data, uint16_t roi, uint16_t begskip=0, uint16_t endskip=0) 860 860 { 861 861 if (roi==0) … … 863 863 864 864 // Skip first 10 samples 865 const uint beg = roi> 10 ? 10: 0;866 const uint end = roi-beg> 5 ? roi-5: roi;865 const uint beg = roi>begskip ? begskip : 0; 866 const uint end = roi-beg>endskip ? roi-endskip : roi; 867 867 const uint len = end-beg; 868 868 … … 887 887 sum /= len; 888 888 sum2 /= len; 889 890 if (i%9!=8 && vec[pos]>0) 889 sum2 -= sum*sum; 890 891 if (i%9!=8) 891 892 patch += vec[pos]; 892 893 if (i%9==8) 894 { 895 patch /= 8; 893 else 894 { 896 895 if (patch > max) 897 896 max = patch; … … 899 898 } 900 899 901 //if (i%9!=8 && vec[pos]>max)902 // max = vec[pos];903 904 900 *(ptr+0*1440+i) = sum; 905 *(ptr+1*1440+i) = s qrt(sum2 - sum * sum);901 *(ptr+1*1440+i) = sum2<0 ? 0 : sqrt(sum2); 906 902 *(ptr+2*1440+i) = vec[pos]; 907 903 *(ptr+3*1440+i) = pos; 908 904 } 909 905 910 return max ;906 return max/8; 911 907 } 912 908
Note:
See TracChangeset
for help on using the changeset viewer.