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

图形图象

开发平台:

Matlab

  1. %%%%%%%%%%%%%%%%%%   第一步:求初始偏移量,估算焦距f0  %%%%%%%%%%%%%%%%%%%
  2. im1=imread('1.jpg');
  3. im2=imread('2.jpg');
  4. L=rgb2gray(im1);
  5. R=rgb2gray(im2);
  6. [r1,c1]=phasec(L,R);
  7. %%
  8. im3=imread('3.jpg');
  9. L=R;
  10. R=rgb2gray(im3);
  11. [r2,c2]=phasec(L,R);
  12. %%
  13. im4=imread('4.jpg');
  14. L=R;
  15. R =rgb2gray(im4);
  16. [r3,c3]=phasec(L,R);
  17. %%
  18. im5=imread('5.jpg');
  19. L=R;
  20. R=rgb2gray(im5);
  21. [r4,c4]=phasec(L,R);
  22. %%
  23. im6=imread('6.jpg');
  24. L=R;
  25. R=rgb2gray(im6);
  26. [r5,c5]=phasec(L,R);
  27. %%
  28. im7=imread('7.jpg');
  29. L=R;
  30. R=rgb2gray(im7);
  31. [r6,c6] =phasec(L,R);
  32. %%
  33. im8 =imread('8.jpg');
  34. L=R;
  35. R=rgb2gray(im8);
  36. [r7,c7] =phasec(L,R);
  37. %%
  38. im9=imread('9.jpg');
  39. L=R;
  40. R=rgb2gray(im9);
  41. [r8,c8] =phasec(L,R);
  42. %%
  43. im10=imread('10.jpg');
  44. L=R;
  45. R =rgb2gray(im10);
  46. [r9,c9]=phasec(L,R);
  47. %%
  48. im11=imread('11.jpg');
  49. L=R;
  50. R=rgb2gray(im11);
  51. [r10,c10]=phasec(L,R);
  52. %%
  53. im12=imread('12.jpg');
  54. L=R;
  55. R=rgb2gray(im12);
  56. [r11,c11]=phasec(L,R);
  57. %%
  58. L=R;
  59. R=rgb2gray(im1);
  60. [r12,c12]=phasec(L,R);
  61. %%
  62. f0=(c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11+c12)/(2*pi);  
  63. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%