statistics (PCA) on piecewise B spline for Shape Model problem using spline toolbox

2 ビュー (過去 30 日間)
AD
AD 2013 年 12 月 6 日
回答済み: Unai San Miguel 2016 年 9 月 29 日
Hi, I want to perform subtraction on two cubic B splines and then project the difference on basis functions. ie. multiply the result by principal components matrix obtained from PCA performed on a group of curves. The problem is that the subtraction result in spline with different number of breaks and coefficients and therefore I can't multiply by the principal components matrix. I assume I need to delete breaks/knots (the opposite operation to 'fnrfn()') to force my new spline to the original number of breaks. How do I do that or does anyone have an alternative proposal?
my code looks something like: splineDiff = fncmb(meanBSpline,'-',proposedSpline); bNewProposed = PCoefs'*(reshape(splineDiff.coefs',1,[])');
both meanBSpline and proposedSpline are pp structures with 30 pieces (1x31 breaks, 60x4 coefs, order 4, dim 2) However, the splineDiff is a pp structure with (on this instance - can vary) 59 pieces (1x60 breaks, 118x4 coefs, order 4, dim 2)) my principal component matrix PCoefs is a 240x18, so I need the reshaped coefs vector of spline Diff to be 240.
Any assistance will be much appreciated

回答 (1 件)

Unai San Miguel
Unai San Miguel 2016 年 9 月 29 日
fncmb takes first both spline functions to the same vector space (same breaks and order in this case). If the breaks are not the same the resulting spline will have the union of both breaks vectors.
One possible approach is to find the spline of the first vector space which is closest to the second one. For instance, if
br = meanBSpline.breaks;
prop_in_mean = csapi(br, fnval(proposedBSpline, br));
is a valid (approximation) solution for you then fncmb(meanBSpline, '-', prop_in_mean) will have exactly the same breaks as meanBSpline.

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by