You are on page 1of 8

Adjusting of Closing Traverse Clock Wise Direction

X(1)=1000; Y(1)=1000; B(1)=(60+(25/60)+(30/3600)); Angles=load('C:\angles.txt'); D=Angles(:,1); M=Angles(:,2); S=Angles(:,3); Angles1=(D+(M/60)+(S/3600)); n=length(D); for i =2:n if B(i-1)<~180 BB(i-1)=B(i-1)+180; B(i)=BB(i-1)-Angles1(i); else BB(i-1)=B(i-1)-180; B(i)=BB(i-1)-Angles1(i); end if B(i)<0 B(i)=B(i)+360 end end for i=1:n Lat(i)=Lengths(i)*cosd(B(i)); Dep(i)=Lengths(i)*sind(B(i)); end Slat=sum(Lat); Sdep=sum(Dep); CE=sqrt((Slat^2)+(Sdep^2)); Slengths=sum(Lengths); CER=CE/Slengths; PCE=1/2000; for i=1:n if CER<~PCE Clat(i)=Lat(i)-((Lengths(i)/Slengths)*Slat); Cdep(i)=Dep(i)-((Lengths(i)/Slengths)*Sdep); X(i+1)=X(i)+Clat(i) Y(i+1)=Y(i)+Cdep(i) else disp('Obs needs to be repreated') end end

CopyRight & Lafif

Page 1

Leveling and its Adjusting

lev=load('C:\lev.txt'); r=lev(:,1); c=lev(:,2); up=lev(:,3); lo=lev(:,4); d=0; rl(1)=100; HI=101.5; for i=1:length(r) if c(i)==2||c(i)==3 rl(i)=HI-r(i) end if i>1&&c(i)==1 HI=rl(i-1)+r(i) end d=d+[[up(i)-lo(i)]*100] end rl1=nonzeros(rl) ce=(rl1(end)-rl(1))*1000 pce=12*sqrt(d/1000) if ce<pce cor=ce/length(rl1) for i=2:length(rl1) Corrected.RL(i)=rl1(i)-((cor/1000)*i) Corrected.RL(1)=rl(1) end else disp('Ops needs to be repeated') end

CopyRight & Lafif

Page 2

Leveling and its Adjusting (Another Solution )

BI=[3 4 1 3 2 3 2]; FI=[2 1 3 2 3 1 4]; UP=[3.1 2.2 1.1 3.3 2.1 3.1 1.2 4.1]; LO=[2.9 1.8 0.9 2.7 1.9 2.9 0.8 3.9]; RL=10; BM=RL; n=length(BI); for i=1:n HI=RL+BI(i); RL=HI-FI(i); RedLevel(i)=RL; end RED=[BM RedLevel] dist=sum((UP-LO)*100) CE=RED(end)-RED(1) PCE=12*sqrt(dist/1000) if CE<PCE COR=CE/(n+1); for i=2:n CorrRl(1)=BM CorrRl(i)=RED(i)-((COR/1000)*i) end else disp('Obs Needs to be Repeated') end

BI :- The Values Of ( B.S and I.S ) FI :- The Values Of ( I.S and F.S )

BS
3 4

IS

FS
2 1 3 2 3

HI
13 15

RL
BM=10 11 14 12 13 12 14 12

UP
3.1 4.1 2.2 1.1 3.3 2.1 3.1 2.1 1.2 4.1

LO
2.9 3.9 1.8 0.9 2.7 1.9 2.9 1.9 0.8 3.9
Page 3

1 4

16

CopyRight & Lafif

Computing Volume ( Fill )

data=load('c:\dat.txt'); RL=10 LS=20 [m,n]=size(data); for i=1:m for j=1:n if data(i,j)==0 data(i,j)=data(i,j) else data(i,j)=RL-data(i,j); end end end a1=data(:,1); a2=data(:,2); a3=data(:,3); a4=data(:,4); sa1=sum(a1) sa2=sum(a2) sa3=sum(a3) sa4=sum(a4) VOL=((LS^2)/4)*(sa1+(2*sa2)+(3*sa3)+4*sa4)

CopyRight & Lafif

Page 4

Geoid Determination

obs=load('c:ons.txt'); LAT=obs(:,1); LON=obs(:,2); H=obs(:,3); lat=obs(:,4); lon=obs(:,5); h=obs(:,6); exi=LAT-lat eta=(LON-lon)*cosd(lat) N=h-H Geoid=[lat lon exi eta N] contour(lat,lon,exi) contour(lat,lon,eta) contour(lat,lon,N) xlabel('phi') ylabel('lamda') title('N')

CopyRight & Lafif

Page 5

Classification of Images

f=imread('D:\A.jpg'); f1=f(:,:,1); % Building signature B=roipoly(f1); [m,n]=size(f1); B1=zeros(m,n); for i=1:m for j=1:n if B(i,j)==1 B1(i,j)=f1(i,j); end end end N=m*n VB1=[reshape(B1,N,1)]; VB1=VB1(VB1>0); pause % Roads signature R=roipoly(f1); [m,n]=size(f1); R1=zeros(m,n); for i=1:m for j=1:n if R(i,j)==1 R1(i,j)=f1(i,j); end end end N=m*n VB1=[reshape(R1,N,1)]; VR1=VR1(VR1>0); pause % Green area signature G=roipoly(G1); [m,n]=size(f1); G1=zeros(m,n); for i=1:m for j=1:n if G(i,j)==1 G1(i,j)=f1(i,j); end end end N=m*n VG1=[reshape(G1,N,1)]; VG1=VG1(VG1>0); signatures=[VB1;VR1;VG1]; dlmwrite('c:\signatures.dat',signatures,'\t');

CopyRight & Lafif

Page 6

pause % cell array names L1=length(VB1); for i=1:L1 name1(i)=1 end name1=name1' pause names=[name1;name2;name3]; dmwrite('C:\names.dat',names,'\t'); % prepare data for classification [nx,ny]=size(f1) N=nx*ny; Allpix=[reshape(f1,N,1)]; Allpix=double(Allpix); signatures=double(signatures); % Fitting a decision tree to the data tree=treefit(signatures(:,:),names); treedisp(tree,'name',{'red'}) % Classify the Image class=treeval(tree,Allpix); % look at the classified data class=reshape(class,nx,ny) map=[225,212,116;109,105,38;183,32,47]/255; figure(2),clf,color(map) image(class),colorbar title('1=building,2=green area,3=roads') imwrite(class,'c:\classes.tif');

CopyRight & Lafif

Page 7

Converting The " RAW " Image to " TRUE COLOR " Image

truecolor=multibandread('paris.lan',[512,512,7],'uint8=>uint8', 128,'bil','ieee-le',{'Band','Direct',[3 2 1]}); figure imshow(truecolor); title('Truecolor Compsed (un-inhanced)') figure imhist(truecolor(:,:,1)) title('Histogram of the Red Band (Band 3)') r=truecolor(:,:,1); g=truecolor(:,:,2); b=truecolor(:,:,3); figure plot3(r(:),g(:),b(:),'.'); grid('on') xlabel('Red (Band 3)') ylabel('Green (Band 2)') zlabel('Blue (Band 1)') title('scatterplot of the visibile bands') stretched_truecolor=imadjust(truecolor,stretchlim(truecolor)); figure imshow(streched_truecolor) title('truecolor composed after contrast streched') figure imhist(streches_trueclor(:,:,1)) title('histogram of Red Band (Band 3) after contrast streched')

CopyRight & Lafif

Page 8

You might also like