Changeset 41531
- Timestamp:
- Apr 3, 2021, 2:16:42 PM (5 years ago)
- Location:
- trunk/psLib/src/astro
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r41519 r41531 1000 1000 const psPlaneTransform *in, 1001 1001 psRegion region, 1002 int nSamples )1002 int nSamples, int extraOrders) 1003 1003 { 1004 1004 PS_ASSERT_PTR_NON_NULL(in, NULL); … … 1026 1026 PS_ASSERT_INT_LARGER_THAN_OR_EQUAL(nSamples, 1, NULL); 1027 1027 1028 // 1029 // Allocate a new psPlaneTransform if "out" is NULL, or has the wrong size. 1030 // 1031 psS32 order = in->x->nX; 1028 1029 // Allocate a new psPlaneTransform if "out" is NULL, or has the wrong size. For a 1030 // non-linear transformation, the inverted solution must have a higher order than the 1031 // forward solution. Since we are fitting a dense grid (generated below), it is not a 1032 // problem (in terms of over-fitting) to use a higher order 1033 1034 // XXX : the extra orders supplied here needs to be something supplied by the user 1035 1036 psS32 order = in->x->nX + extraOrders; 1032 1037 psPlaneTransform *myPT = NULL; 1033 1038 if (out == NULL) { … … 1036 1041 // the user has supplied a model with a specific order : fit that order 1037 1042 myPT = psMemIncrRefCounter(out); // we need to return something which can be freed 1038 # if (0)1039 if ((out->x->nX == order) && (out->x->nY == order) &&1040 (out->y->nX == order) && (out->y->nX == order)) {1041 myPT = out;1042 } else {1043 psFree(out);1044 myPT = psPlaneTransformAlloc(order, order);1045 }1046 # endif1047 1043 } 1048 1044 -
trunk/psLib/src/astro/psCoord.h
r39926 r41531 348 348 const psPlaneTransform *in, ///< transform to invert 349 349 psRegion region, ///< region to fit for non-linear transform inversion 350 int nSamples ///< number of samples in each axis for fit 350 int nSamples, ///< number of samples in each axis for fit 351 int extraOrders ///< increase the order of the output by the amount vs input, if input is non-linear 351 352 ); 352 353
Note:
See TracChangeset
for help on using the changeset viewer.
