

Collaborator: Raf Jaculbia
//Scilab code
chdir("C:\Documents and Settings\AP186user17\Desktop\ap18657activity13"); loadmatfile("Photos.mat");
V1 = {0.085832, 0.17365, 0.98106};
V2 = {0.085832, -0.17365, 0.98106};
V3 = {0.17365, 0, 0.98481};
V4 = {0.16318, -0.34202, 0.92542};
I(1, :) = I1(:)';
I(2, :) = I2(:)';
I(3, :) = I3(:)';
I(4, :) = I4(:)';
V = cat(1, V1, V2, V3, V4);
g = (inv(V'*V))*V'*I;
len = size(g);
len = len(2);
n = [];
mag = [];
for i = 1:len
mag(i) = sqrt(g(1, i)**2 + g(2, i)**2 + g(3, i)**2);
end
mag = mag';
n(1, :) = g(1, :)./(mag + 0.00000000000001);
n(2, :) = g(2, :)./(mag + 0.00000000000001);
n(3, :) = (g(3, :)./(mag + 0.00000000000001)) + 0.00000000000001;
dfdx = -(n(1, :))./n(3, :);
dfdy = -(n(2, :))./n(3, :);
dfdx = matrix(dfdx, [128, 128]);
dfdy = matrix(dfdy, [128, 128]);
lintfx = cumsum(dfdx, 2);
lintfy = cumsum(dfdy, 1);
z = lintfx + lintfy;
plot3d(1:128, 1:128, z)
//end of code
1 comment:
sorry what is the matrix function
Post a Comment