- Timestamp:
- Apr 20, 2011, 10:52:17 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourceMoments.c
r31312 r31327 130 130 Sum = 0.0; // the second pass may include slightly different pixels, re-determine Sum 131 131 132 // float dX = source->moments->Mx - source->peak->xf; 133 // float dY = source->moments->My - source->peak->yf; 134 // float dR = hypot(dX, dY); 135 // float Xo = (dR < 2.0) ? source->moments->Mx : source->peak->xf; 136 // float Yo = (dR < 2.0) ? source->moments->My : source->peak->yf; 137 float Xo = source->moments->Mx; 138 float Yo = source->moments->My; 139 132 140 // center of mass in subimage. Note: the calculation below uses pixel index, so we correct 133 141 // xCM, yCM from pixel coords to pixel index here. 134 psF32 xCM = source->moments->Mx- 0.5 - source->pixels->col0; // coord of peak in subimage135 psF32 yCM = source->moments->My- 0.5 - source->pixels->row0; // coord of peak in subimage142 psF32 xCM = Xo - 0.5 - source->pixels->col0; // coord of peak in subimage 143 psF32 yCM = Yo - 0.5 - source->pixels->row0; // coord of peak in subimage 136 144 137 145 for (psS32 row = 0; row < source->pixels->numRows ; row++) { … … 142 150 psF32 *vPix = source->pixels->data.F32[row]; 143 151 psF32 *vWgt = source->variance->data.F32[row]; 152 144 153 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 154 // psImageMaskType *vMsk = (source->maskView == NULL) ? NULL : source->maskView->data.PS_TYPE_IMAGE_MASK_DATA[row]; 145 155 146 156 for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) { … … 280 290 psF32 *vPix = source->pixels->data.F32[row]; 281 291 psF32 *vWgt = source->variance->data.F32[row]; 292 282 293 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 294 // psImageMaskType *vMsk = (source->maskView == NULL) ? NULL : source->maskView->data.PS_TYPE_IMAGE_MASK_DATA[row]; 283 295 284 296 for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) { … … 391 403 psF32 *vPix = source->pixels->data.F32[row]; 392 404 psF32 *vWgt = source->variance->data.F32[row]; 405 393 406 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 407 // psImageMaskType *vMsk = (source->maskView == NULL) ? NULL : source->maskView->data.PS_TYPE_IMAGE_MASK_DATA[row]; 394 408 395 409 for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
Note:
See TracChangeset
for help on using the changeset viewer.
