solve tasks 1 1 2 1 1 3 1 2 2 1 2 3 and 2 2 2 do not use any built in
Search for question
Question
Solve tasks 1.1.2, 1.1.3, 1.2.2, 1.2.3 and 2.2.2. Do not use any built-in functions in Matlab. Use only
addition, subtraction, multiplication, division, square
root, power, matrix inverse, matrix transpose, summation, mean, min, max, integral2, eig, load(),
size().
For simplicity, we start with simple quadratical surfaces of the general formulation:
z= f(x,y) = Ax2 + By2 + Cxy + Dx + Ey+ F.
(1)
The objective is to estimate the unknown parameters A, B, C, D, E and F using the observed points in the provided
file 'quadratic surface.mat'. The fitting error is
(2)
which is minimized when a = 0, δε = 0, ΔΕ = 0, 0 = 0, δ£ = 0 and of = 0. Refer to the lecture notes', use
linear regression to estimate the unknown parameters A, B, C, D, E and F.
N
Σ(Ax + By? + Cxy + Dx + Ey + F –z)2
t=
Task 1.1.1 Derive six linear quati involving the unknown parameters A, B, C, D, E and F based on the
error minimization condition. Then, reformulate these linear equations into the form of Eq.(3). Namely, derive the
matrix XEROX6 and vector Y € Ro in Eq.(3).
Completed task 1.1.1
Σε
Σαν
xy
Σαν
Σε
Σχένι
Σε
xí
ΓΧου Χοι ΧΟΖ Χος Χος Χος
Χιο Χης Χης Χ13 Χ14 Χις
1X20 Χ21 Χ22 Χ23 Χ24 Χης
1X30 Χ31Χ32 X33 X34 Xas D
ΙΧΑΟ ΧΑΙ ΧΑΖ Χ43 ΧΑΑ Χός E
X50 X51 X52 X53 X54 X55] F
Task 1.1.2 Estimate the unknown parameters A, B, C, D, E and F by solving Eq.(3).
Task 1.1.3 Report the volume bounded by the estimated surface and the ground plane (z = 0) by evaluating the
integral Josxeseisygy f(x,y)dxdy.
Σχέν Σαν
Exy
yi
C
Σε
λα λα λα λα λα
Σαν Σαν
xy
x² Σχινι
Σ Σ Σανι
yi
xiyi
Yi
y
χένι Σκιν
xi yi
xi yi
x²yi
x?
Xiyi
Συ Σαν Στ
y
Σ» Σαν Σε
Xiyi
Xi
XiVi
y
τω
Yi
y
Xiyi
Xi
Yi
N
tooomi
(3)
II
x? Zi
y? Zi
XiYiZi
XiZi
YiZi
MI
Zi The quadratic surface model assumes smooth and simple shapes. A bivariate cubic function can model more
complex shapes of a bulk. In this context, the sensed surface is approximated by the following cubic function,
z = f(x,y) = Ax3 + By + Cxy + Dxy2 + Ex? + Fy? + Gxy +Hx+ Iy + 1
The objective is to estimate the unknown parameters A, B, C, D, E,F,G,H, and J with the observed points in
the provided file 'cubic surface.mat". The fitting error is
(4)
(5)
which is minimized when of = 0, 0 = 0, 8€ = 0, 0 = 0,0€ = 0,8F = 0, 86 = 0, 95 = 0, f = 0 and af = 0.
Task 1.2.1 Derive ten linear equations involving the unknown parameters A, B,C,D,E,F,G,H, I and J based on
the error minimization condition. Then, reformulate these linear equations into the form of Eq.(6). Namely, derive
the matrix XER 10x10 and vector Y€ Rio in Eq.(6).
N
(Ax3 + By + Cxy; + Dxy? + Ex? + Fy? + Gxy; + Hx; + lyi+1-z)2
ΓΧου Χοι Χοζ Χος Χου Χος Χος Χοτ Χοβ Χορζ ΓΑ
Χ1 Χ12 Χ14 Χης Χίο Χιτ Χ18 Χιο B
Χιο
Χ21 Χ22
Χ24 Χης
Χζο Χατ
Χ28 Χ 20
Χ13
Χ23
X33
ΧΑ3 ΧΑΑ
Χ31Χ32
X34 Χος
ΧΑΙ ΧΑΖ
ΧΑς
Χ30 Χ3τ Χ38 Χ 30
ΧΑΟ Χιτ Χ18 Χιο
Xss Xso Χιτ Χ18 Χιο
Χος Χου Χοτ Χος Χο
Xso
Xs1 Xs2 X53
Xst
| Χου Χοι Χοζ Χος Χολ
ΙΧΤο
Χτζ Χτζ ΧΤΑ
Χτς Χτο Χτ ΧτΒ Χτο
Χτι
X80 X1 X2 X3 X4 X5 X86 X87 XB8 X89
LXgo Χοι Χοζ Χοζ Χολ Χος Χος Χοτ Χοβ Χορζ
xy;
1X20
| X30
ΧΑΟ
Σ
Xiy
Xiyi
αν
xfyi xy
Σαν Σε Σαν Σαν
xy
_x?y?
κέν Σαν Σαν Σ Σαν
xy
y
xy
x{y}
xy
xyi Xiyi
x¡y?
y²
x
Σχν
xyi xy
Σε
κένι Σαν
Σαν Σαν
x Σκv? Σαν Σε Σχνι
xy
xy
xiyi
και Συ
xy
Σαν Σαν Σ Σαν
Ση
Xiyi
y
Σαν
Σαν
xy;
x{y} x{y}
yi
Σαν Σ
xy
xy
Σαν Σως Σαν Σαν Σαν Σα
xty?
x¡y{
x?y?
xy
x{y}
Xiy
Σε
x
xy
xyi
xy
xfyi
x?y?
yi xy
MI
y
D
ULOI-
E
x} yi
H
|
11
Yg
xyi
xy
xyi x
Σ
Σαν Σ
[x²y? [x²y. Σxy?
x} yi
Σ
xy Σ
Xi Yi
xyi
xy
Σε
Συ Σαν
Στέν Σαν Σχνι
Σαν Σε
x² yi
Task 1.2.2 Estimate the unknown parameters A, B, C, D, E,F,G,H,I and J by solving Eq.(6).
Task 1.2.3 Report the volume bounded by the estimated surface and the ground plane (z = 0) by evaluating the
integral Josxetine fraisysyf(x,y)dxdy.
XiVi
Xi
Xiyi
y
τω
XiYi
Yi
xzi
yi zi
x²yizi
x₁y} Zi
xzi
y} Zi
N
XiYiZi
Xi Zi
Σχετι
τω
Ζή The explicit representation z=f(x,y) introduced in Topic 1 has a significant limitation in efficiently representing
arbitrary surfaces, particularly when a location (x,y) corresponds to multiple height z. In contrast, implicit represen-
tation can easily represent arbitrary topological structures. In this method, the surface S is implicitly defined by the
zero-level set of a function f(x.y.z), denoted as $ = {(x,y,z)|f(x,y,z) = 0}. For simplicity, here we constrain
the form of f(x, y, z) to a quadratic function: f(x, y, z)= Ax² +By²+Cz²+Dxy+Eyz+Fxz+Gx+Hy+lz+J.
The error on fitting an implicit representation is
N
c = = E(Ax} + By? + Cz? +Dxy + Ey,z, + Fxz, + Gx + Hy, + Iz + 1 – 02
i-1
which is minimized when f = 0, 0 = 0, 0 = 0,86 = 0, 8£ = 0,8£ = 0, 8c = 0, @f = 0, f = 0 and of = 0.
Task 2.1 Derive ten linear equations involving the unknown parameters A,B,C,D,E,F,G,H, I and J based on
the error minimization condition. Then, reformulate these linear equations into the form of Eq.(8). Namely, derive
the matrix X € 110x10 in Eq.(8).
Σχετι
xzi
Σχ
xt
x?y?
xz
x²³ yi
ΓΧου Χοι Χοζ Χοζ Χος Χος Χος Χοτ Χος Χορτ [Α]
1Χ10 Χ1 Χ12 Χ13 Χ14 Χης Χιό Χιτ Χ18 Χιο B
Χης Χης Χατ Χ28 Χο
1Χ20 Χ21 Χ22 Χ 23
C
Χ24
X31 X32 X33 X34
X30
Χ35
Χ30 Χ3 X38 Χ30
D
Χ40 ΧΑΙ ΧΑΖ ΧΑ3 ΧΑΑ ΧΑς ΧΑς Χιτ Χ18 Χιο
| Xso Xει
Χεζ Χεζ Xs4 Xss Xso Χιτ Χ18 Χιο
ΙΧσο Χοι Χοζ Χοζ Χός Χος Χος Χοτ Χός Χερ
ΙΧτο Χτι Χτζ Χτζ ΧΤΑ Χτς Χτο Χτ Χτ8 Χτο
Xgo Χοι Χgz XB3 X84 Χος Χου Χοτ Xes Xeo
LXgo Χοι Χοζ Χοζ Χολ Χος Χος Χοτ Χος Χαολ
yz
x Συνz?
x? Yizi
yizi αν Viz
Σχετι Σχετινες Σχ x;Z
Σχ Σαν Σε
xiz
x² yi
Task 2.2
For the observed points in 'implicit_l.mat', estimate their corresponding parameters A, B, C, D, E, F,G,H,1
and J. Then, based on the value and signs of these parameters, classify the type of underlying surface.
• Hint: directly solving Eq. (8) will result in a solution whose elements are all zero. To address this prob-
lem, we can use the eigenvector of X corresponding to the smallest eigenvalue of X as an estimate of
[A, B, C, D,E,F,G,H,1,JJT. The relationship between this eigenvector v and the corresponding ground
truth parameters θ = [A,B,C,D,E,F,G,H,1,JJT is v = αθ + n where a is a scale factor and n denotes the
model noise.
Σ»
Σαν Σνική
xy
y? Zi
• For the observed points in file 'implicit_2.mati, estimate their corresponding parameters A, B, C, D, E, F,G,H,I
and J. Then, based on the value and signs of these parameters, classify the type of underlying surface.
• Note: Refer to Fig.2, recognize the surface type by analyzing the values and signs of surface parameters.
You must not draw a conclusion via eyeballing.
Στο
x
Σxy Ex?z Σχένι Σχέντι Σχει Στ
yt
yz
x¡y?
Σνακ Σαν Σ
Στο
Xiyiz? Viz
Σ
xiz
xi yi
Σχν?
x?y?
Σκινέζι
Zi
Zi
Σνικ
κινέζι
χένιτι Σκινιζέ
Σχινιτι
x?yiZi
yizi Σχετιν
Σχένι
Σχνι
x² yi
ουυοΙ·
H
yz
||
XiYiZi
Στο Σχινι Συ
XiVi
-
xri
νέζι Σχινιτι
yzi XiYiZi
yız?
xiz
.......
xiz
Σχένιαι
Σκιντέ Σ
Σχέτ
xz
XiZi
Xiyiz? XiYiZi
Σχέτι
Σ.
Σχινι
Xi Yi
Σ XiZi
Xi
WW
x? Yi
xiy
y? Zi
Σχινιτι
XiYiZi
Viz
Σ z²
xv? Σχινίζε
Σχινι
Xi Yi
y?
YiZi
xzi
Yi
y? Zi
Viz
Σχει Στ
XiZi Σ
YiZi
Στ
Xiyi
YiZi
Zi
XiZi
0
Xi
Yi
Zi Ellipsoid
Eliptic parabolaid
Non-degenerate real quadric surfaces
Hyperbolic paraboloid
Hyperboloid of one sheet
or
Hyperbolic hyperboloid
Hyperboloid of two sheets
or
Eliptic hyperboloid
2²
+
+
12
#
T