projandadj_2.m
资源名称:ibrmasac.rar [点击查看]
上传用户:jiangyu148
上传日期:2014-10-19
资源大小:2124k
文件大小:4k
源码类别:
图形图象
开发平台:
Matlab
- %投影,调整形状
- width=640;
- height=480;
- width_o=round(width/2);
- height_o=round(height/2);
- dest1=zeros([height,width,3],'uint8');
- dest2=zeros([height,width,3],'uint8');
- dest3=zeros([height,width,3],'uint8');
- dest4=zeros([height,width,3],'uint8');
- dest5=zeros([height,width,3],'uint8');
- dest6=zeros([height,width,3],'uint8');
- dest7=zeros([height,width,3],'uint8');
- dest8=zeros([height,width,3],'uint8');
- dest9=zeros([height,width,3],'uint8');
- dest10=zeros([height,width,3],'uint8');
- dest11=zeros([height,width,3],'uint8');
- dest12=zeros([height,width,3],'uint8');
- f=f0;
- for w=1:width
- for h=1:height
- y1=round(sqrt(f^2/((w-width_o)^2+f^2))*(h-height_o))+height_o;
- x1=round(sqrt(f^2/((w-width_o)^2+f^2))*(w-width_o))+width_o;
- dest1(y1,x1,1)=im1(h,w,1);
- dest1(y1,x1,2)=im1(h,w,2);
- dest1(y1,x1,3)=im1(h,w,3);
- dest2(y1,x1,1)=im2(h,w,1);
- dest2(y1,x1,2)=im2(h,w,2);
- dest2(y1,x1,3)=im2(h,w,3);
- dest3(y1,x1,1)=im3(h,w,1);
- dest3(y1,x1,2)=im3(h,w,2);
- dest3(y1,x1,3)=im3(h,w,3);
- dest4(y1,x1,1)=im4(h,w,1);
- dest4(y1,x1,2)=im4(h,w,2);
- dest4(y1,x1,3)=im4(h,w,3);
- dest5(y1,x1,1)=im5(h,w,1);
- dest5(y1,x1,2)=im5(h,w,2);
- dest5(y1,x1,3)=im5(h,w,3);
- dest6(y1,x1,1)=im6(h,w,1);
- dest6(y1,x1,2)=im6(h,w,2);
- dest6(y1,x1,3)=im6(h,w,3);
- dest7(y1,x1,1)=im7(h,w,1);
- dest7(y1,x1,2)=im7(h,w,2);
- dest7(y1,x1,3)=im7(h,w,3);
- dest8(y1,x1,1)=im8(h,w,1);
- dest8(y1,x1,2)=im8(h,w,2);
- dest8(y1,x1,3)=im8(h,w,3);
- dest9(y1,x1,1)=im9(h,w,1);
- dest9(y1,x1,2)=im9(h,w,2);
- dest9(y1,x1,3)=im9(h,w,3);
- dest10(y1,x1,1)=im10(h,w,1);
- dest10(y1,x1,2)=im10(h,w,2);
- dest10(y1,x1,3)=im10(h,w,3);
- dest11(y1,x1,1)=im11(h,w,1);
- dest11(y1,x1,2)=im11(h,w,2);
- dest11(y1,x1,3)=im11(h,w,3);
- dest12(y1,x1,1)=im12(h,w,1);
- dest12(y1,x1,2)=im12(h,w,2);
- dest12(y1,x1,3)=im12(h,w,3);
- if w==1
- if h==1
- w_1 =x1;
- h_1 =y1;
- end
- if h==height
- h_2=y1;
- end
- end
- if w==width
- if h==1
- w_2 =x1;
- end
- end
- end;
- end;
- I1=imcrop(dest1,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I2=imcrop(dest2,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I3=imcrop(dest3,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I4=imcrop(dest4,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I5=imcrop(dest5,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I6=imcrop(dest6,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I7=imcrop(dest7,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I8=imcrop(dest8,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I9=imcrop(dest9,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I10=imcrop(dest10,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I11=imcrop(dest11,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- I12=imcrop(dest12,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
- % I1=imcrop(dest1,[w_1,h_1,(w_2-w_1),height]);
- % I2=imcrop(dest2,[w_1,h_1,(w_2-w_1),height]);
- % I3=imcrop(dest3,[w_1,h_1,(w_2-w_1),height]);
- % I4=imcrop(dest4,[w_1,1,(w_2-w_1),height]);
- % I5=imcrop(dest5,[w_1,1,(w_2-w_1),height]);
- % I6=imcrop(dest6,[w_1,1,(w_2-w_1),height]);
- % I7=imcrop(dest7,[w_1,1,(w_2-w_1),height]);
- % I8=imcrop(dest8,[w_1,1,(w_2-w_1),height]);
- % I9=imcrop(dest9,[w_1,1,(w_2-w_1),height]);
- % I10=imcrop(dest10,[w_1,1,(w_2-w_1),height]);
- % I11=imcrop(dest11,[w_1,1,(w_2-w_1),height]);
- % I12=imcrop(dest12,[w_1,1,(w_2-w_1),height]);
- % imwrite(I1,'I1.jpg');
- % imwrite(I2,'I2.jpg');
- % imwrite(I3,'I3.jpg');
- % imwrite(I4,'I4.jpg');
- % imwrite(I5,'I5.jpg');
- % imwrite(I6,'I6.jpg');
- % imwrite(I7,'I7.jpg');
- % imwrite(I8,'I8.jpg');
- % imwrite(I9,'I9.jpg');
- % imwrite(I10,'I10.jpg');
- % imwrite(I11,'I11.jpg');
- % imwrite(I12,'I12.jpg');