- Timestamp:
- Mar 29, 2009, 6:15:31 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pswarp/src/pswarpMapGrid.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpMapGrid.c
r21323 r23594 43 43 // measure the map for the center of each superpixel 44 44 for (ni = 0, i = xMin; ni < nXpts; i += nXpix, ni++) { 45 for (nj = 0, j = yMin; nj < nYpts; j += nYpix, nj++) {46 pswarpMapSetLocalModel (grid->maps[ni][nj], dest, src, i, j);47 }45 for (nj = 0, j = yMin; nj < nYpts; j += nYpix, nj++) { 46 pswarpMapSetLocalModel (grid->maps[ni][nj], dest, src, i, j); 47 } 48 48 } 49 49 50 50 grid->nXpix = nXpix; 51 51 grid->nYpix = nYpix; … … 112 112 113 113 for (int i = 0; i < grid->nXpts - 1; i++) { 114 for (int j = 0; j < grid->nYpts - 1; j++) {115 116 // measure the output coordinates for the next grid position using the current grid map117 // compare with the coordinates measured using the next grid map118 pswarpMapApply (&xRaw, &yRaw, grid->maps[i][j], grid->maps[i][j]->xo + grid->nXpix, grid->maps[i][j]->yo);119 pswarpMapApply (&xRef, &yRef, grid->maps[i+1][j], grid->maps[i][j]->xo + grid->nXpix, grid->maps[i][j]->yo);120 121 double posError = hypot (xRaw-xRef, yRaw-yRef);122 maxError = PS_MAX (maxError, posError);123 }124 } 114 for (int j = 0; j < grid->nYpts - 1; j++) { 115 116 // measure the output coordinates for the next grid position using the current grid map 117 // compare with the coordinates measured using the next grid map 118 pswarpMapApply (&xRaw, &yRaw, grid->maps[i][j], grid->maps[i][j]->xo + grid->nXpix, grid->maps[i][j]->yo); 119 pswarpMapApply (&xRef, &yRef, grid->maps[i+1][j], grid->maps[i][j]->xo + grid->nXpix, grid->maps[i][j]->yo); 120 121 double posError = hypot (xRaw-xRef, yRaw-yRef); 122 maxError = PS_MAX (maxError, posError); 123 } 124 } 125 125 return maxError; 126 126 } … … 176 176 psPlaneTransformApply (FP, fpaDest->fromTPA, TP); 177 177 psPlaneTransformApply (V00, chipDest->fromFPA, FP); 178 178 179 179 /** V(1,0) position */ 180 180 offset->x = ix + 1; … … 186 186 psPlaneTransformApply (FP, fpaDest->fromTPA, TP); 187 187 psPlaneTransformApply (V10, chipDest->fromFPA, FP); 188 188 189 189 /** V(0,1) position */ 190 190 offset->x = ix; … … 204 204 map->Yy = V01->y - V00->y; 205 205 map->Yo = V00->y - map->Yx*ix - map->Yy*iy; 206 206 207 207 map->xo = ix; 208 208 map->yo = iy; … … 224 224 } 225 225 226 pswarpMap *pswarpMapAlloc () {226 pswarpMap *pswarpMapAlloc(void) { 227 227 228 228 pswarpMap *map = (pswarpMap *) psAlloc (sizeof(pswarpMap)); … … 238 238 239 239 for (int i = 0; i < grid->nXpts; i++) { 240 for (int j = 0; j < grid->nYpts; j++) {241 psFree (grid->maps[i][j]);242 }243 psFree (grid->maps[i]);240 for (int j = 0; j < grid->nYpts; j++) { 241 psFree (grid->maps[i][j]); 242 } 243 psFree (grid->maps[i]); 244 244 } 245 245 psFree (grid->maps); … … 256 256 grid->maps[i] = psAlloc (nYpts*sizeof(void *)); 257 257 for (int j = 0; j < nYpts; j++) { 258 grid->maps[i][j] = pswarpMapAlloc();258 grid->maps[i][j] = pswarpMapAlloc(); 259 259 } 260 260 } … … 264 264 grid->nXpix = 0; 265 265 grid->nYpix = 0; 266 266 267 267 return grid; 268 268 }
Note:
See TracChangeset
for help on using the changeset viewer.
