CodePudding user response:
Xlim ([min Max (x) (x)]);Plot (x, yy, 'r', 'our LineWidth, 2);
hold on;
Figure (4);
Subplot (1, 2, 1);
0-0 at x1=.05: n - 1;
A=size (x1);
Len=a (2) - 1;
X11=x1 (1: len);
F11=fftshift (FFT (yy));
F11=abs (f11);
The plot (x11, f11);
Subplot (1,2,2);
[f11y f11x]=Max (f11);
Fjie=f11 (f11x: end);
X0=find ((fjie/f11 (f11x)) & lt; 0.00001);
F12=(f11 (f11x: (f11x + x0) (1) - 1))/f11 (f11x);
X2=linspace (0, 1, x0 (1));
The plot (x2, f12);
Figure (5)
The plot (x2, f12);
Set (gca, 'xtick' 0-0. 1:1).
The grid on;
hold on;
The save TMP. The mat f12 x2;
clear all;
close all;
The load TMP. Mat;
I11=imread (' c: \ Users \ \ Administrator \ Desktop \ 3 xx. BMP ');
I=imrotate (I11-270);
I1=double (I);
[m, n]=size (I);
A=zeros (1, n);
Cii=1: (n - 1) * 20 + 1
Zz [z]=size (cii)
Summ=a;
B=zeros (1, m);
Yyy=0;
For li=1:1: m
Figure (1);
Subplot (2, 2, 1);
Hang=I1 (li, :); % to read each line of image data
I=[1: n];
The plot (I, hang, 'r', 'our linewidth, 2); Each line % shows the original grayscale distribution
% set (gca, 'xtick', 0-2: n)
hold on;
The grid on;
Before the title (' edge spread function (PSF) at all levels (interpolation) ');
Yidao=diff (hang, 1);
[on3dmax, jizhi]=Max (abs (yidao));
Lindian=linspace (jizhi, jizhi + 2, 5);
Hang1=hang (jizhi - 2: jizhi + 2);
C=polyfit (lindian hang1, 3);
Lindian1=jizhi - 2-0. 01: jizhi + 2;
D=polyval (c, lindian1);
The plot (lindian1, d, 'g')
hold on;
Yidao1=diff (d, 1);
[dmax1, jizhi1]=Max (yidao1);
Jizhi1=jizhi - 2 + (jizhi1/100);
B (li)=jizhi1;
% cubic spline interpolationXx=1-0.05: n.
, hang, xx yy=spline (I);
Subplot (2, 2, 3);
The plot (xx, yy);
hold on;
The grid on;
Title (' edge spread function test results at all levels (after interpolation) ');
Summ=summ + hang; Before every % on behalf of the cubic spline interpolation curve addition
Yyy=yy + yyy; % yyy represent every curve after interpolation addition
End
Figure (1);
Subplot (2,2,2);
I=[1: n];
The plot (I, summ/(255 * m), 'g', 'our linewidth, 2);
% set (gca, 'xtick', 0-2: n)
hold on;
The grid on;
The title (' average edge spread function (not interpolation));
Subplot (2, 2, 4-trichlorobenzene);
Cii=1-0.05: n.
The plot (cii, yyy/(255 * m), 'g', 'our linewidth, 2);
The grid on;
hold on;
Title (' average edge spread function after three times spline interpolation () ');
Figure (2);
Imshow (uint8 (I1));
hold on;
I1=[1-1: m];
The plot (b, i1, '* r);
hold on;
C1=polyfit (b, i1, 1);
D1=polyval (c1, i1); % d1 anchor point represents the final and the like yuan
The plot (i1, d1, 'b', 'our linewidth, 2);
CodePudding user response:
hold on;The title (' edge detection results');
Figure (3);
Subplot (1, 2, 1);
LSF=diff (yyy);
Lsf1=abs (LSF);
[zz, z]=size (lsf1);
X=linspace (1, n, z);
X=x ';
Y=lsf1;
Y=y ';
[ymax, xmax]=Max (y);
Xlim ([min Max (x) (x)]);
The plot (x, y, '. ')
The plot (x, y, '- b).
hold on;
% s=fitoptions (' the Startpoint, 20 20 [20]);
% f=fittype (" a * exp (- (x -) b/c ^ 2) ', 'options', s);
% [cfun, gof]=fit (x (:), y (:), f);
Yy cfun=%. A * exp (- ((x - cfun. B)/cfun. C). ^ 2);
% [ymax, xmax]=Max (yy);
F='a * exp (- (x -) b/c ^ 2)';
StartPoints=[20 20 20];
F1=fit (x, y, f, 'Start', startPoints);
Xlim ([min Max (x) (x)]);
The plot (f1);
[ymax xmax]=Max (f1 (x));
Yidong=floor (xmax/20) + (xmax - floor xmax/20 * 20) * 0.05;
Subplot (1,2,2);
X=x ';
Y=y ';
Yy=(f1 (x));
X=x - yidong;
Xlim ([min Max (x) (x)]);
Plot (x, yy, 'r', 'our LineWidth, 2);
hold on;
Figure (4);
Subplot (1, 2, 1);
0-0 at x1=.05: n - 1;
A=size (x1);
Len=a (2) - 1;
X11=x1 (1: len);
F11=fftshift (FFT (yy));
F11=abs (f11);
The plot (x11, f11);
Subplot (1,2,2);
[f11y f11x]=Max (f11);
Fjie=f11 (f11x: end);
X0=find ((fjie/f11 (f11x)) & lt; 0.00001);
F122=(f11 (f11x: (f11x + x0) (1) - 1))/f11 (f11x);
X22=linspace (0, 1, x0 (1));
The plot (x22 f122);
Figure (5)
The plot (x22 f122);
Set (gca, 'xtick' 0-0. 1:1).
The grid on;
hold on;
close all;
Subplot (1, 2, 1);
The plot (x2, f12, '* r);
hold on;
The plot (x2, f12, 'b');
hold on;
The grid on;
The title (' vertical track direction);
Subplot (1,2,2);
The plot (x22 f122, 'b');
hold on;
The plot (x22 f122, 'r');
hold on;
The grid on;
The title (' direction along the rail);
Figure;
Subplot (1, 2, 1);
% to select the frequency of the whole point of the MTF values
Xi=1-0/10000:1;
Yi=interp1 (x2, f12, xi, 'linear');
The plot (xi, yi, 'b');
hold on;
Wan1 (1)=1;
For 2=1000, 1000:10000
Temp=floor (ii/1000) + 1;
Wan1 (temp)=yi (ii);
End
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull