function RPC = Rpc_Reader(rpc_filename)
% 读取RPC文件内容
fid=fopen(rpc_filename,'r');

read_one_line = fgetl(fid);
read_one_line = fgetl(fid);
read_one_line = fgetl(fid);
read_one_line = fgetl(fid);
read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',});
errBias=str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',});
errRand=str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',});
RPC.lineOffset =str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',});
RPC.sampOffset=str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',});
RPC.latOffset =str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',','});
RPC.longOffset=str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',','});
RPC.heightOffset=str2double(temp(2));


read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',','});
RPC.linescale=str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',','});
RPC.samplescale=str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',','});
RPC.latScale =str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',','});
RPC.longScale =str2double(temp(2));

read_one_line = fgetl(fid);
temp=strsplit(read_one_line,{';','=',')',','});
RPC.heightScale =str2double(temp(2));

read_one_line = fgetl(fid);
for i=1:20
    read_one_line = fgetl(fid);
    temp=strsplit(read_one_line,{';','=',')',','});
    RPC.num_l_coef(i)=str2double(temp(1));
end
read_one_line = fgetl(fid);
for i=1:20
    read_one_line = fgetl(fid);
    temp=strsplit(read_one_line,{';','=',')',','});
    RPC.den_l_coef(i)=str2double(temp(1));
end
read_one_line = fgetl(fid);
for i=1:20
    read_one_line = fgetl(fid);
    temp=strsplit(read_one_line,{';','=',')',','});
    RPC.num_s_coef(i)=str2double(temp(1));
end
read_one_line = fgetl(fid);
for i=1:20
    read_one_line = fgetl(fid);
    temp=strsplit(read_one_line,{';','=',')',','});
    RPC.den_s_coef(i)=str2double(temp(1));
end
fclose(fid);
end