projandadj_4.m
上传用户:jiangyu148
上传日期:2014-10-19
资源大小:2124k
文件大小:3k
源码类别:

图形图象

开发平台:

Matlab

  1. f=f1;
  2. for w=1:width    
  3.     for h=1:height      
  4.     y1=round(sqrt(f^2/((w-width_o)^2+f^2))*(h-height_o))+height_o;     
  5.     x1=round(sqrt(f^2/((w-width_o)^2+f^2))*(w-width_o))+width_o;         
  6.      dest1(y1,x1,1)=im1(h,w,1);      
  7.      dest1(y1,x1,2)=im1(h,w,2);     
  8.      dest1(y1,x1,3)=im1(h,w,3);    
  9.      dest2(y1,x1,1)=im2(h,w,1);      
  10.      dest2(y1,x1,2)=im2(h,w,2);     
  11.      dest2(y1,x1,3)=im2(h,w,3);
  12.      dest3(y1,x1,1)=im3(h,w,1);      
  13.      dest3(y1,x1,2)=im3(h,w,2);     
  14.      dest3(y1,x1,3)=im3(h,w,3);
  15.      dest4(y1,x1,1)=im4(h,w,1);      
  16.      dest4(y1,x1,2)=im4(h,w,2);     
  17.      dest4(y1,x1,3)=im4(h,w,3);
  18.      dest5(y1,x1,1)=im5(h,w,1);      
  19.      dest5(y1,x1,2)=im5(h,w,2);     
  20.      dest5(y1,x1,3)=im5(h,w,3);
  21.      dest6(y1,x1,1)=im6(h,w,1);      
  22.      dest6(y1,x1,2)=im6(h,w,2);     
  23.      dest6(y1,x1,3)=im6(h,w,3);    
  24.      dest7(y1,x1,1)=im7(h,w,1);      
  25.      dest7(y1,x1,2)=im7(h,w,2);     
  26.      dest7(y1,x1,3)=im7(h,w,3);
  27.      dest8(y1,x1,1)=im8(h,w,1);      
  28.      dest8(y1,x1,2)=im8(h,w,2);     
  29.      dest8(y1,x1,3)=im8(h,w,3);
  30.      dest9(y1,x1,1)=im9(h,w,1);      
  31.      dest9(y1,x1,2)=im9(h,w,2);     
  32.      dest9(y1,x1,3)=im9(h,w,3);
  33.      dest10(y1,x1,1)=im10(h,w,1);      
  34.      dest10(y1,x1,2)=im10(h,w,2);     
  35.      dest10(y1,x1,3)=im10(h,w,3);
  36.      dest11(y1,x1,1)=im11(h,w,1);      
  37.      dest11(y1,x1,2)=im11(h,w,2);     
  38.      dest11(y1,x1,3)=im11(h,w,3);
  39.      dest12(y1,x1,1)=im12(h,w,1);      
  40.      dest12(y1,x1,2)=im12(h,w,2);     
  41.      dest12(y1,x1,3)=im12(h,w,3);
  42.      if w==1 
  43.           if h==1
  44.              w_1 =x1;
  45.              h_1 =y1;
  46.           end
  47.           if h==height
  48.               h_2=y1;
  49.           end
  50.      end
  51.      if w==width
  52.           if h==1
  53.              w_2 =x1;
  54.           end    
  55.      end    
  56.    end;
  57. end;
  58. I1=imcrop(dest1,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  59. I2=imcrop(dest2,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  60. I3=imcrop(dest3,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  61. I4=imcrop(dest4,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  62. I5=imcrop(dest5,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  63. I6=imcrop(dest6,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  64. I7=imcrop(dest7,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  65. I8=imcrop(dest8,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  66. I9=imcrop(dest9,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  67. I10=imcrop(dest10,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  68. I11=imcrop(dest11,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  69. I12=imcrop(dest12,[w_1,h_1,(w_2-w_1),(h_2-h_1)]);
  70.  imwrite(I1,'I1.jpg');
  71.  imwrite(I2,'I2.jpg');
  72.  imwrite(I3,'I3.jpg');
  73.  imwrite(I4,'I4.jpg');
  74.  imwrite(I5,'I5.jpg');
  75.  imwrite(I6,'I6.jpg');
  76.  imwrite(I7,'I7.jpg');
  77.  imwrite(I8,'I8.jpg');
  78.  imwrite(I9,'I9.jpg');
  79.  imwrite(I10,'I10.jpg');
  80.  imwrite(I11,'I11.jpg');
  81.  imwrite(I12,'I12.jpg');