next up previous contents
Next: Files Up: Polynomials (1) Previous: Exercise 11

Exercise 12

On a grid with $x,y$-Koordinaten we have the following greyvalues of a digital image:
y\x 1 2 3 4
1 98 110 122 136
2 91 112 131 141
3 73 118 145 190
4 43 129 170 230
Which greyvalue do you expect at position $x=2,35; y=2,74$? Calculate the bicubic interpolation.

Solution:

>> Z=[98,110,122,136;
> 91,112,131,141;
> 73,118,145,190;
> 43,129,170,230];
>> i=1; p=polyfit(1:4,Z(i,:),3); z(i)=polyval(p,2.35);
>> i=2; p=polyfit(1:4,Z(i,:),3); z(i)=polyval(p,2.35);
>> i=3; p=polyfit(1:4,Z(i,:),3); z(i)=polyval(p,2.35);
>> i=4; p=polyfit(1:4,Z(i,:),3); z(i)=polyval(p,2.35);
>> p=polyfit(1:4,z,3); zp=polyval(p,2.74)
zp = 124.82
0


next up previous contents
Next: Files Up: Polynomials (1) Previous: Exercise 11
Helmut Dersch
2009-03-15