function [Dom, Aom, Answer, Bn] = Analysis(stats1, stats2, Line, Img, flag)
if nargin < 5
flag = 1;
end
Line1 = Line{1};
Line2 = Line{2};
Line3 = Line{3};
Line4 = Line{4};
yn1 = round(Line1(1, 2) + 0.18*(Line2(1, 2)-Line1(1, 2)));
yn2 = round(Line1(1, 2) + 0.34*(Line2(1, 2)-Line1(1, 2)));
yn3 = round(Line1(1, 2) + 0.50*(Line2(1, 2)-Line1(1, 2)));
Linen1_1 = [Line1(1, 1) yn1; Line1(2, 1) yn1];
Linen2_1 = [Line1(1, 1) yn2; Line1(2, 1) yn2];
Linen3_1 = [Line1(1, 1) yn3; Line1(2, 1) yn3];
% 定位竖直网格分割线
xn1 = round(Line3(1, 1) + 0.22*(Line4(1, 1)-Line3(1, 1)));
xn2 = round(Line3(1, 1) + 0.26*(Line4(1, 1)-Line3(1, 1)));
xn3 = round(Line3(1, 1) + 0.48*(Line4(1, 1)-Line3(1, 1)));
xn4 = round(Line3(1, 1) + 0.52*(Line4(1, 1)-Line3(1, 1)));
xn5 = round(Line3(1, 1) + 0.73*(Line4(1, 1)-Line3(1, 1)));
xn6 = round(Line3(1, 1) + 0.77*(Line4(1, 1)-Line3(1, 1)));
xn7 = round(Line3(1, 1) + 0.98*(Line4(1, 1)-Line3(1, 1)));
Linen1_2 = [xn1 Line3(1, 2); xn1 Line3(2, 2)];
Linen2_2 = [xn2 Line3(1, 2); xn2 Line3(2, 2)];
Linen3_2 = [xn3 Line3(1, 2); xn3 Line3(2, 2)];
Linen4_2 = [xn4 Line3(1, 2); xn4 Line3(2, 2)];
Linen5_2 = [xn5 Line3(1, 2); xn5 Line3(2, 2)];
Linen6_2 = [xn6 Line3(1, 2); xn6 Line3(2, 2)];
Linen7_2 = [xn7 Line3(1, 2); xn7 Line3(2, 2)];
ym1_1 = round(Line1(1, 2) + 0.32*(Linen1_1(1, 2)-Line1(1, 2)));
ym2_1 = round(Line1(1, 2) + 0.5*(Linen1_1(1, 2)-Line1(1, 2)));
ym3_1 = round(Line1(1, 2) + 0.65*(Linen1_1(1, 2)-Line1(1, 2)));
ym4_1 = round(Line1(1, 2) + 0.80*(Linen1_1(1, 2)-Line1(1, 2)));
ym5_1 = round(Line1(1, 2) + 0.95*(Linen1_1(1, 2)-Line1(1, 2)));
Linem1_1 = [Line1(1, 1) ym1_1; Line1(2, 1) ym1_1];
Linem2_1 = [Line1(1, 1) ym2_1; Line1(2, 1) ym2_1];
Linem3_1 = [Line1(1, 1) ym3_1; Line1(2, 1) ym3_1];
Linem4_1 = [Line1(1, 1) ym4_1; Line1(2, 1) ym4_1];
Linem5_1 = [Line1(1, 1) ym5_1; Line1(2, 1) ym5_1];
ym1_2 = round(Linen1_1(1, 2) + 0.25*(Linen2_1(1, 2)-Linen1_1(1, 2)));
ym2_2 = round(Linen1_1(1, 2) + 0.40*(Linen2_1(1, 2)-Linen1_1(1, 2)));
ym3_2 = round(Linen1_1(1, 2) + 0.60*(Linen2_1(1, 2)-Linen1_1(1, 2)));
ym4_2 = round(Linen1_1(1, 2) + 0.75*(Linen2_1(1, 2)-Linen1_1(1, 2)));
ym5_2 = round(Linen1_1(1, 2) + 0.90*(Linen2_1(1, 2)-Linen1_1(1, 2)));
Linem1_2 = [Line1(1, 1) ym1_2; Line1(2, 1) ym1_2];
Linem2_2 = [Line1(1, 1) ym2_2; Line1(2, 1) ym2_2];
Linem3_2 = [Line1(1, 1) ym3_2; Line1(2, 1) ym3_2];
Linem4_2 = [Line1(1, 1) ym4_2; Line1(2, 1) ym4_2];
Linem5_2 = [Line1(1, 1) ym5_2; Line1(2, 1) ym5_2];
ym1_3 = round(Linen2_1(1, 2) + 0.25*(Linen3_1(1, 2)-Linen2_1(1, 2)));
ym2_3 = round(Linen2_1(1, 2) + 0.40*(Linen3_1(1, 2)-Linen2_1(1, 2)));
ym3_3 = round(Linen2_1(1, 2) + 0.60*(Linen3_1(1, 2)-Linen2_1(1, 2)));
ym4_3 = round(Linen2_1(1, 2) + 0.75*(Linen3_1(1, 2)-Linen2_1(1, 2)));
ym5_3 = round(Linen2_1(1, 2) + 0.90*(Linen3_1(1, 2)-Linen2_1(1, 2)));
Linem1_3 = [Line1(1, 1) ym1_3; Line1(2, 1) ym1_3];
Linem2_3 = [Line1(1, 1) ym2_3; Line1(2, 1) ym2_3];
Linem3_3 = [Line1(1, 1) ym3_3; Line1(2, 1) ym3_3];
Linem4_3 = [Line1(1, 1) ym4_3; Line1(2, 1) ym4_3];
Linem5_3 = [Line1(1, 1) ym5_3; Line1(2, 1) ym5_3];
xm1_1 = round(Line3(1, 1) + 0.07*(Linen1_2(1, 1)-Line3(1, 1)));
xm1_2 = round(Line3(1, 1) + 0.25*(Linen1_2(1, 1)-Line3(1, 1)));
xm1_3 = round(Line3(1, 1) + 0.43*(Linen1_2(1, 1)-Line3(1, 1)));
xm1_4 = round(Line3(1, 1) + 0.63*(Linen1_2(1, 1)-Line3(1, 1)));
xm1_5 = round(Line3(1, 1) + 0.83*(Linen1_2(1, 1)-Line3(1, 1)));
xm1_6 = round(Line3(1, 1) + 1.02*(Linen1_2(1, 1)-Line3(1, 1)));
Linem1_1_2 = [xm1_1 Line3(1, 2); xm1_1 Line3(2, 2)];
Linem1_2_2 = [xm1_2 Line3(1, 2); xm1_2 Line3(2, 2)];
Linem1_3_2 = [xm1_3 Line3(1, 2); xm1_3 Line3(2, 2)];
Linem1_4_2 = [xm1_4 Line3(1, 2); xm1_4 Line3(2, 2)];
Linem1_5_2 = [xm1_5 Line3(1, 2); xm1_5 Line3(2, 2)];
Linem1_6_2 = [xm1_6 Line3(1, 2); xm1_6 Line3(2, 2)];
xm2_1 = round(Linen2_2(1, 1) + 0.05*(Linen3_2(1, 1)-Linen2_2(1, 1)));
xm2_2 = round(Linen2_2(1, 1) + 0.22*(Linen3_2(1, 1)-Linen2_2(1, 1)));
xm2_3 = round(Linen2_2(1, 1) + 0.41*(Linen3_2(1, 1)-Linen2_2(1, 1)));
xm2_4 = round(Linen2_2(1, 1) + 0.58*(Linen3_2(1, 1)-Linen2_2(1, 1)));
xm2_5 = round(Linen2_2(1, 1) + 0.78*(Linen3_2(1, 1)-Linen2_2(1, 1)));
xm2_6 = round(Linen2_2(1, 1) + 0.98*(Linen3_2(1, 1)-Linen2_2(1, 1)));
Linem2_1_2 = [xm2_1 Line3(1, 2); xm2_1 Line3(2, 2)];
Linem2_2_2 = [xm2_2 Line3(1, 2); xm2_2 Line3(2, 2)];
Linem2_3_2 = [xm2_3 Line3(1, 2); xm2_3 Line3(2, 2)];
Linem2_4_2 = [xm2_4 Line3(1, 2); xm2_4 Line3(2, 2)];
Linem2_5_2 = [xm2_5 Line3(1, 2); xm2_5 Line3(2, 2)];
Linem2_6_2 = [xm2_6 Line3(1, 2); xm2_6 Line3(2, 2)];
xm3_1 = round(Linen4_2(1, 1) + 0.03*(Linen5_2(1, 1)-Linen4_2(1, 1)));
xm3_2 = round(Linen4_2(1, 1) + 0.22*(Linen5_2(1, 1)-Linen4_2(1, 1)));
xm3_3 = round(Linen4_2(1, 1) + 0.41*(Linen5_2(1, 1)-Linen4_2(1, 1)));
xm3_4 = round(Linen4_2(1, 1) + 0.58*(Linen5_2(1, 1)-Linen4_2(1, 1)));
xm3_5 = round(Linen4_2(1, 1) + 0.78*(Linen5_2(1, 1)-Linen4_2(1, 1)));
xm3_6 = round(Linen4_2(1, 1) + 0.98*(Linen5_2(1, 1)-Linen4_2(1, 1)));
Linem3_1_2 = [xm3_1 Line3(1, 2); xm3_1 Line3(2, 2)];
Linem3_2_2 = [xm3_2 Line3(1, 2); xm3_2 Line3(2, 2)];
Linem3_3_2 = [xm3_3 Line3(1, 2); xm3_3 Line3(2, 2)];
Linem3_4_2 = [xm3_4 Line3(1, 2); xm3_4 Line3(2, 2)];
Linem3_5_2 = [xm3_5 Line3(1, 2); xm3_5 Line3(2, 2)];
Linem3_6_2 = [xm3_6 Line3(1, 2); xm3_6 Line3(2, 2)];
xm4_1 = round(Linen6_2(1, 1) + 0.03*(Linen7_2(1, 1)-Linen6_2(1, 1)));
xm4_2 = round(Linen6_2(1, 1) + 0.22*(Linen7_2(1, 1)-Linen6_2(1, 1)));
xm4_3 = round(Linen6_2(1, 1) + 0.41*(Linen7_2(1, 1)-Linen6_2(1, 1)));
xm4_4 = round(Linen6_2(1, 1) + 0.58*(Linen7_2(1, 1)-Linen6_2(1, 1)));
xm4_5 = round(Linen6_2(1, 1) + 0.78*(Linen7_2(1, 1)-Linen6_2(1, 1)));
xm4_6 = round(Linen6_2(1, 1) + 0.98*(Linen7_2(1, 1)-Linen6_2(1, 1)));
Linem4_1_2 = [xm4_1 Line3(1, 2); xm4_1 Line3(2, 2)];
Linem4_2_2 = [xm4_2 Line3(1, 2); xm4_2 Line3(2, 2)];
Linem4_3_2 = [xm4_3 Line3(1, 2); xm4_3 Line3(2, 2)];
Linem4_4_2 = [xm4_4 Line3(1, 2); xm4_4 Line3(2, 2)];
Linem4_5_2 = [xm4_5 Line3(1, 2); xm4_5 Line3(2, 2)];
Linem4_6_2 = [xm4_6 Line3(1, 2); xm4_6 Line3(2, 2)];
ym1_4 = round(Line1(1, 2) - 0.18*(Linen1_1(1, 2)-Line1(1, 2)));
ym2_4 = round(Line1(1, 2) - 0.35*(Linen1_1(1, 2)-Line1(1, 2)));
ym3_4 = round(Line1(1, 2) - 0.50*(Linen1_1(1, 2)-Line1(1, 2)));
ym4_4 = round(Line1(1, 2) - 0.65*(Linen1_1(1, 2)-Line1(1, 2)));
ym5_4 = round(Line1(1, 2) - 0.80*(Linen1_1(1, 2)-Line1(1, 2)));
ym6_4 = round(Line1(1, 2) - 0.95*(Linen1_1(1, 2)-Line1(1, 2)));
ym7_4 = round(Line1(1, 2) - 1.10*(Linen1_1(1, 2)-Line1(1, 2)));
ym8_4 = round(Line1(1, 2) - 1.22*(Linen1_1(1, 2)-Line1(1, 2)));
ym9_4 = round(Line1(1, 2) - 1.35*(Linen1_1(1, 2)-Line1(1, 2)));
ym10_4 = round(Line1(1, 2) - 1.50*(Linen1_1(1, 2)-Line1(1, 2)));
ym11_4 = round(Line1(1, 2) - 1.65*(Linen1_1(1, 2)-Line1(1, 2)));
Linem1_4 = [Line1(1, 1) ym1_4; Line1(2, 1) ym1_4];
Linem2_4 = [Line1(1, 1) ym2_4; Line1(2, 1) ym2_4];
Linem3_4 = [Line1(1, 1) ym3_4; Line1(2, 1) ym3_4];
Linem4_4 = [Line1(1, 1) ym4_4; Line1(2, 1) ym4_4];
Linem5_4 = [Line1(1, 1) ym5_4; Line1(2, 1) ym5_4];
Linem6_4 = [Line1(1, 1) ym6_4; Line1(2, 1) ym6_4];
Linem7_4 = [Line1(1, 1) ym7_4; Line1(2, 1) ym7_4];
Linem8_4 = [Line1(1, 1) ym8_4; Line1(2, 1) ym8_4];
Linem9_4 = [Line1(1, 1) ym9_4; Line1(2, 1) ym9_4];
Linem10_4 = [Line1(1, 1) ym10_4; Line1(2, 1) ym10_4];
Linem11_4 = [Line1(1, 1) ym11_4; Line1(2, 1) ym11_4];
Dom(1).Loc = [Line1(1, 2) Linen1_1(1, 2)];
Dom(1).y = [ym1_1 ym2_1 ym3_1 ym4_1 ym5_1];
xt{1} = [xm1_1 xm1_2 xm1_3 xm1_4 xm1_5 xm1_6];
xt{2} = [xm2_1 xm2_2 xm2_3 xm2_4 xm2_5 xm2_6];
xt{3} = [xm3_1 xm3_2 xm3_3 xm3_4 xm3_5 xm3_6];
xt{4} = [xm4_1 xm4_2 xm4_3 xm4_4 xm4_5 xm4_6];
Dom(1).x = xt;
Dom(2).Loc = [Linen1_1(1, 2) Linen2_1(1, 2)];
Dom(2).y = [ym1_2 ym2_2 ym3_2 ym4_2 ym5_2];
xt{1} = [xm1_1 xm1_2 xm1_3 xm1_4 xm1_5 xm1_6];
xt{2} = [xm2_1 xm2_2 xm2_3 xm2_4 xm2_5 xm2_6];
xt{3} = [xm3_1 xm3_2 xm3_3 xm3_4 xm3_5 xm3_6];
xt{4} = [xm4_1 xm4_2 xm4_3 xm4_4 xm4_5 xm4_6];
Dom(2).x = xt;
Dom(3).Loc