How to fit a polynomial surface to point cloud using any optimization method?

์กฐํšŒ ์ˆ˜: 31 (์ตœ๊ทผ 30์ผ)
moaad
moaad 2023๋…„ 1์›” 21์ผ
ํŽธ์ง‘: Saarthak Gupta 2023๋…„ 9์›” 6์ผ
suppose the data points are given (point cloud:Q_r) , and i want to fit a polynomial surface to the given data points. Suppose the surface Bezier surface
where , if m,n=3, then the bicubic surface in term of polynomial function become
The goal is to obtain the free-form polynomial Bezier surface (bicubic for my case) that fits the data points better in the discrete least-squares sense. To do so, we have to compute the control points P_{๐‘–,๐‘—},๐‘–=0,...,๐‘š;๐‘—=0,...,๐‘› of the approximating surface by minimizing the least-squares error, ๐ธ, defined as the sum of squares of the residuals:
.
Is there any way we can apply MATLAB optimization technique, so that i will get the best coefficient (P_{i,j}) that fit the original data?
To find best (P_{i,j}) i need to find best u and v parameter vector that will give me best (P_{i,j}) using least square.
Any suggestions, recomendation, link to c.f is appreciated.

์ฑ„ํƒ๋œ ๋‹ต๋ณ€

Saarthak Gupta
Saarthak Gupta 2023๋…„ 9์›” 5์ผ
ํŽธ์ง‘: Saarthak Gupta 2023๋…„ 9์›” 6์ผ
Hi moaad,
As per my understanding, you are trying to fit a Bezier polynomial to a given set of points (Q_r). MATLAB offers the โ€˜fitโ€™ function as part of the Curve Fitting Toolbox, which can help you achieve the desired result.
Refer to the following steps:
  • Define the Bezier polynomial as an anonymous function. It is important that in the input order of the anonymous function, the coefficients (p00,โ€ฆ,p33) must precede the independent variables (x, y).
Bezier_bicubic = @(p00,p01,p02,p03,p10 โ€ฆ p33,x,y) (1-x)^3*(1-y)^3*p00 โ€ฆ x^3*y^3*p33;
  • Use the anonymous function as an input to the โ€˜fitโ€™ function.
[f1, gof_params] = fit([Xr, Yr], Qr, Bezier_bicubic);
fit returns an โ€˜sfitโ€™ object (f1) and a โ€˜gofโ€™ structure (gof_params). โ€˜gof_paramsโ€™ contains the goodness-of-fit statistics, and can further be used to evaluate how well the model fit the data.
The same results can also be reproduced interactively. Please refer to the following example for more information: https://in.mathworks.com/help/curvefit/custom-nonlinear-surface-fitting-examples.html
Please refer to the following MATLAB documentation for more details:

์ถ”๊ฐ€ ๋‹ต๋ณ€ (0๊ฐœ)

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Fit Postprocessing์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

Community Treasure Hunt

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

Start Hunting!

Translated by