N-Dimensional smoothing spline weighting
4 次查看(过去 30 天)
显示 更早的评论
Is anybody aware of how to use the weighting option of the csaps function for N-dimensional matrices? As an example, I can currently call csaps to fit a smoothing spline to a 2D MxN image, I, with a command like:
x = {1:M, 1:N};
spl_smooth = csaps(x, I);
I would like to fit a smoothing spline using a weighting matrix that has the same dimensions as the input image but it does not appear that I can do this with csaps since the weighting input argument must be a cell array with the same number of entries as the first input, x. This makes the size of the weighting argument {1xM, 1xN}, whereas I want it to be MxN.
Thank you for any help you can offer,
Avery
0 个评论
回答(2 个)
Unai San Miguel
2018-12-10
You can use a cell of two set of weights, one in each direction of the input
csaps({1:M, 1:N}, I, [], {wi, wj});
with wi an array of weights of size [1, M] and wj an array of weights of size [1, N]. In this way at least you have constant-slices weighting.
4 个评论
Unai San Miguel
2018-12-11
And varying the p parameters from {0.9, 0.9} as defaults to some other values?
A smoothing spline will always decrease the smoothed matrix in the trusted regions (and increase it in the untrusted ones), won't it?
I would try to reason first in 1D. If you could make up an example in 1D, that is, 1-valued, 1-variate functions maybe I could understand better your case. Not meaning I would be able to help, though...
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spline Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!