31 |
|
#ifndef RSCA |
32 |
|
#define RSCA 2.0 /* radius scaling factor (empirical) */ |
33 |
|
#endif |
34 |
+ |
#ifndef MAXSLOPE |
35 |
+ |
#define MAXSLOPE 200.0 /* maximum slope for smooth region */ |
36 |
+ |
#endif |
37 |
|
#ifndef SMOOTH_MSE |
38 |
|
#define SMOOTH_MSE 5e-5 /* acceptable mean squared error */ |
39 |
|
#endif |
140 |
|
dsf_grid[pos[0]][pos[1]].sum.n++; |
141 |
|
/* add in X and Z values */ |
142 |
|
if (rbf_colorimetry == RBCtristimulus) { |
143 |
< |
spec_grid[0][pos[0]][pos[1]] += val[0]; |
144 |
< |
spec_grid[1][pos[0]][pos[1]] += val[2]; |
143 |
> |
spec_grid[0][pos[0]][pos[1]] += cfact * val[0]; |
144 |
> |
spec_grid[1][pos[0]][pos[1]] += cfact * val[2]; |
145 |
|
} |
146 |
|
} |
147 |
|
|
212 |
|
return(1); /* colinear values */ |
213 |
|
A = DOT(rMtx[0], xvec); |
214 |
|
B = DOT(rMtx[1], xvec); |
215 |
+ |
if (A*A + B*B > MAXSLOPE*MAXSLOPE) /* too steep? */ |
216 |
+ |
return(0); |
217 |
|
C = DOT(rMtx[2], xvec); |
218 |
|
sqerr = 0.0; /* compute mean squared error */ |
219 |
|
for (x = x0; x < x1; x++) |