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!