亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? go_calib_optim_iter_weak.m

?? 經典的張正友的攝像機的兩步標定程序
?? M
?? 第 1 頁 / 共 2 頁
字號:
%%% WARNING!!! This code is not in working condition yet.
%%% AS A RESULT, IT IS NOT SUPPORTED!!!
%%% -Jean-Yves Bouguet

%go_calib_optim_iter_weak
%
%Main calibration function. Computes the intrinsic andextrinsic parameters
%for the weak perspective camera model
%Runs as a script.
%
%INPUT: x_1,x_2,x_3,...: Feature locations on the images
%       X_1,X_2,X_3,...: Corresponding grid coordinates
%
%OUTPUT: fc: Camera focal length
%        cc: Principal point coordinates
%        alpha_c: Skew coefficient
%        kc: Distortion coefficients
%        KK: The camera matrix (containing fc and cc)
%        omc_1,omc_2,omc_3,...: 3D rotation vectors attached to the grid positions in space
%        Tc_1,Tc_2,Tc_3,...: 3D translation vectors attached to the grid positions in space
%        Rc_1,Rc_2,Rc_3,...: 3D rotation matrices corresponding to the omc vectors
%
%Method: Minimizes the pixel reprojection error in the least squares sense over the intrinsic
%        camera parameters, and the extrinsic parameters (3D locations of the grids in space)
%
%Note: If the intrinsic camera parameters (fc, cc, kc) do not exist before, they are initialized through
%      the function init_intrinsic_param.m. Otherwise, the variables in memory are used as initial guesses.
%
%Note: The row vector active_images consists of zeros and ones. To deactivate an image, set the
%      corresponding entry in the active_images vector to zero.
%
%VERY IMPORTANT: This function works for 2D and 3D calibration rigs, except for init_intrinsic_param.m
%that is so far implemented to work only with 2D rigs.
%In the future, a more general function will be there.
%For now, if using a 3D calibration rig, quick_init is set to 1 for an easy initialization of the focal length



%%% Little modifications for weak perspective model:
center_optim = 0; % No center estimation for weak perspective model
%est_dist = zeros(5,1); % No distortion for weak perspective model
%est_alpha = 0; % No skew for weak perspective model



if ~exist('desactivated_images'),
    desactivated_images = [];
end;

if ~exist('est_aspect_ratio'),
    est_aspect_ratio = 1;
end;

if ~exist('est_fc');
    est_fc = [1;1]; % Set to zero if you do not want to estimate the focal length (it may be useful! believe it or not!)
end;

if ~exist('recompute_extrinsic'),
    recompute_extrinsic = 1; % Set this variable to 0 in case you do not want to recompute the extrinsic parameters
    % at each iterstion.
end;


if ~exist('MaxIter'),
    MaxIter = 30; % Maximum number of iterations in the gradient descent
end;

if ~exist('check_cond'),
    check_cond = 1; % Set this variable to 0 in case you don't want to extract view dynamically
end;

if ~exist('center_optim'),
    center_optim = 1; %%% Set this variable to 0 if your do not want to estimate the principal point
end;

if exist('est_dist'),
    if length(est_dist) == 4,
        est_dist = [est_dist ; 0];
    end;
end;

if ~exist('est_dist'),
    est_dist = [1;1;1;1;0];
end;

if ~exist('est_alpha'),
    est_alpha = 0; % by default, do not estimate skew
end;


% Little fix in case of stupid values in the binary variables:
center_optim = double(~~center_optim);
est_alpha = double(~~est_alpha);
est_dist = double(~~est_dist);
est_fc = double(~~est_fc);
est_aspect_ratio = double(~~est_aspect_ratio);



fprintf(1,'\n');

if ~exist('nx')&~exist('ny'),
    fprintf(1,'WARNING: No image size (nx,ny) available. Setting nx=640 and ny=480. If these are not the right values, change values manually.\n');
    nx = 640;
    ny = 480;
end;


check_active_images;


quick_init = 0; % Set to 1 for using a quick init (necessary when using 3D rigs)


% Check 3D-ness of the calibration rig:
rig3D = 0;
for kk = ind_active,
    eval(['X_kk = X_' num2str(kk) ';']);
    if is3D(X_kk),
        rig3D = 1;
    end;
end;


if center_optim & (length(ind_active) < 2) & ~rig3D,
    fprintf(1,'WARNING: Principal point rejected from the optimization when using one image and planar rig (center_optim = 1).\n');
    center_optim = 0; %%% when using a single image, please, no principal point estimation!!!
    est_alpha = 0;
end;

if ~exist('dont_ask'),
    dont_ask = 0;
end;

if center_optim & (length(ind_active) < 5) & ~rig3D,
    fprintf(1,'WARNING: The principal point estimation may be unreliable (using less than 5 images for calibration).\n');
    %if ~dont_ask,
    %   quest = input('Are you sure you want to keep the principal point in the optimization process? ([]=yes, other=no) ');
    %   center_optim = isempty(quest);
    %end;
end;


% A quick fix for solving conflict
if ~isequal(est_fc,[1;1]),
    est_aspect_ratio=1;
end;
if ~est_aspect_ratio,    est_fc=[1;1];
end;


if ~est_aspect_ratio,
    fprintf(1,'Aspect ratio not optimized (est_aspect_ratio = 0) -> fc(1)=fc(2). Set est_aspect_ratio to 1 for estimating aspect ratio.\n');
else
    if isequal(est_fc,[1;1]),
        fprintf(1,'Aspect ratio optimized (est_aspect_ratio = 1) -> both components of fc are estimated (DEFAULT).\n');
    end;
end;

if ~isequal(est_fc,[1;1]),
    if isequal(est_fc,[1;0]),
        fprintf(1,'The first component of focal (fc(1)) is estimated, but not the second one (est_fc=[1;0])\n');
    else
        if isequal(est_fc,[0;1]),
            fprintf(1,'The second component of focal (fc(1)) is estimated, but not the first one (est_fc=[0;1])\n');
        else
            fprintf(1,'The focal vector fc is not optimized (est_fc=[0;0])\n');
        end;
    end;
end;


if ~center_optim, % In the case where the principal point is not estimated, keep it at the center of the image
    fprintf(1,'Principal point not optimized (center_optim=0). Default state for weak perspective model');
    if ~exist('cc'),
        fprintf(1,'It is kept at the center of the image.\n');
        cc = [(nx-1)/2;(ny-1)/2];
    else
        fprintf(1,'Note: to set it in the middle of the image, clear variable cc, and run calibration again.\n');
    end;
else
    fprintf(1,'Principal point optimized (center_optim=1) - (DEFAULT). To reject principal point, set center_optim=0\n');
end;


if ~center_optim & (est_alpha),
    fprintf(1,'WARNING: Since there is no principal point estimation (center_optim=0), no skew estimation (est_alpha = 0)\n');
    est_alpha = 0;  
end;

if ~est_alpha,
    fprintf(1,'Skew not optimized (est_alpha=0) - (DEFAULT)\n');
    alpha_c = 0;
else
    fprintf(1,'Skew optimized (est_alpha=1). To disable skew estimation, set est_alpha=0.\n');
end;


if ~prod(double(est_dist)),
    fprintf(1,'Distortion not fully estimated (defined by the variable est_dist):\n');
    if ~est_dist(1),
        fprintf(1,'     Second order distortion not estimated (est_dist(1)=0) - (DEFAULT for weak perspective model) . \n');
    end;
    if ~est_dist(2),
        fprintf(1,'     Fourth order distortion not estimated (est_dist(2)=0) - (DEFAULT for weak perspective model) .\n');
    end;
    if ~est_dist(5),
        fprintf(1,'     Sixth order distortion not estimated (est_dist(5)=0) - (DEFAULT for weak perspective model) .\n');
    end;
    if ~prod(double(est_dist(3:4))),
        fprintf(1,'     Tangential distortion not estimated (est_dist(3:4)~=[1;1]) - (DEFAULT for weak perspective model) .\n');
    end;
end;


% Check 3D-ness of the calibration rig:
rig3D = 0;
for kk = ind_active,
    eval(['X_kk = X_' num2str(kk) ';']);
    if is3D(X_kk),
        rig3D = 1;
    end;
end;

% If the rig is 3D, then no choice: the only valid initialization is manual!
if rig3D,
    quick_init = 1;
end;



alpha_smooth = 1; % set alpha_smooth = 1; for steepest gradient descent


% Conditioning threshold for view rejection
thresh_cond = 1e6;



%% Initialization of the intrinsic parameters (if necessary)

if ~exist('cc'),
    fprintf(1,'Initialization of the principal point at the center of the image.\n');
    cc = [(nx-1)/2;(ny-1)/2];
    alpha_smooth = 0.4; % slow convergence
end;


if exist('kc'),
    if length(kc) == 4;
        fprintf(1,'Adding a new distortion coefficient to kc -> radial distortion model up to the 6th degree');
        kc = [kc;0];
    end;
end;


if ~exist('kc'),
    fprintf(1,'Initialization of the image distortion to zero.\n');
    kc = zeros(5,1);
    alpha_smooth = 0.4; % slow convergence
end;

if ~exist('alpha_c'),
    fprintf(1,'Initialization of the image skew to zero.\n');
    alpha_c = 0;
    alpha_smooth = 0.4; % slow convergence
end;

if ~exist('fc')& quick_init,
    FOV_angle = 35; % Initial camera field of view in degrees
    fprintf(1,['Initialization of the focal length to a FOV of ' num2str(FOV_angle) ' degrees.\n']);
    fc = (nx/2)/tan(pi*FOV_angle/360) * ones(2,1);
    est_fc = [1;1];
    alpha_smooth = 0.4; % slow 
end;


if ~exist('fc'),
    % Initialization of the intrinsic parameters:
    fprintf(1,'Initialization of the intrinsic parameters using the vanishing points of planar patterns.\n')
    init_intrinsic_param; % The right way to go (if quick_init is not active)!
    alpha_smooth = 0.4; % slow convergence
    est_fc = [1;1];
end;


if ~est_aspect_ratio,
    fc(1) = (fc(1)+fc(2))/2;
    fc(2) = fc(1);
end;

if ~prod(double(est_dist)),
    % If no distortion estimated, set to zero the variables that are not estimated
    kc = kc .* est_dist;
end;


if ~prod(double(est_fc)),
    fprintf(1,'Warning: The focal length is not fully estimated (est_fc ~= [1;1])\n');
end;


%%% Initialization of the extrinsic parameters for global minimization:
comp_ext_calib;



%%% Initialization of the global parameter vector:

init_param = [fc;cc;alpha_c;kc;zeros(5,1)]; 

for kk = 1:n_ima,
    eval(['omckk = omc_' num2str(kk) ';']);
    eval(['Tckk = Tc_' num2str(kk) ';']);
    init_param = [init_param; omckk ; Tckk];    
end;


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久9999吃药| 欧美精品乱人伦久久久久久| 七七婷婷婷婷精品国产| 中文字幕av一区二区三区高| 在线观看欧美黄色| 国产+成+人+亚洲欧洲自线| 亚洲一区二区五区| 国产精品午夜在线观看| 欧美日韩1区2区| 91丨九色porny丨蝌蚪| 韩国一区二区在线观看| 亚洲国产成人tv| 国产精品国产自产拍在线| 2020日本不卡一区二区视频| 欧美视频一区二区| 91视频免费看| av成人动漫在线观看| 国产精品69毛片高清亚洲| 亚洲电影在线播放| 亚洲欧美偷拍卡通变态| 国产日韩欧美不卡| 久久久久久一二三区| 日韩一级免费观看| 日韩一级黄色大片| 91精品国产综合久久久久久漫画 | 9191国产精品| 在线观看一区不卡| 欧美日韩一卡二卡三卡 | 成人激情免费网站| 99久久国产综合精品女不卡| 国产黄色精品视频| 国产成人av电影| 国产91精品欧美| jvid福利写真一区二区三区| 成人激情免费电影网址| 99久久久免费精品国产一区二区| 波波电影院一区二区三区| 色综合久久综合网欧美综合网| 91小视频免费看| 欧美日韩在线亚洲一区蜜芽| 精品国产一区二区三区av性色| 26uuu亚洲综合色| 日韩码欧中文字| 日本不卡1234视频| 顶级嫩模精品视频在线看| 色偷偷成人一区二区三区91| 欧美精品日韩综合在线| 久久新电视剧免费观看| 一区二区三区蜜桃| 久久er精品视频| 色综合天天综合| 久久久99精品久久| 亚洲伊人伊色伊影伊综合网| 久久国产精品72免费观看| 91伊人久久大香线蕉| 国产精品美女久久久久久2018 | 欧美成人精品1314www| 国产精品三级av| 美女尤物国产一区| 91麻豆国产福利在线观看| 2023国产一二三区日本精品2022| 亚洲国产一区二区视频| 黄色成人免费在线| 欧美精品v国产精品v日韩精品| 久久精品一区二区三区不卡 | 日韩精品影音先锋| 天天影视涩香欲综合网| 色妹子一区二区| 国产精品乱人伦一区二区| 久久精品国产免费看久久精品| 欧美日韩国产不卡| 亚洲欧美激情视频在线观看一区二区三区 | 中文字幕在线观看一区| 国产精品一区一区三区| 欧美影院一区二区| 欧美激情一区二区三区蜜桃视频 | 激情久久五月天| 久久香蕉国产线看观看99| 色综合久久综合| 亚洲人成在线观看一区二区| 大美女一区二区三区| 自拍偷拍国产精品| 在线亚洲一区二区| 日本欧美大码aⅴ在线播放| 宅男噜噜噜66一区二区66| 美女视频网站黄色亚洲| 久久亚洲二区三区| 色香蕉成人二区免费| 亚洲精品久久久蜜桃| 精品国产免费人成在线观看| 狠狠色2019综合网| 日韩欧美自拍偷拍| 国产伦理精品不卡| 久久综合狠狠综合久久激情| 成人免费毛片片v| 香蕉成人伊视频在线观看| 欧美肥妇free| 国产成人免费av在线| 日韩一区欧美小说| 日韩一区二区免费视频| 91视频免费播放| 久久99精品久久久| 一区二区三区 在线观看视频| 欧美人体做爰大胆视频| 成人三级在线视频| 美国三级日本三级久久99| 亚洲成人一区在线| 精品精品欲导航| 91亚洲国产成人精品一区二区三| 亚洲bdsm女犯bdsm网站| 日本一区二区视频在线| 精品久久久久久久久久久久久久久久久| 欧美亚洲日本国产| 风流少妇一区二区| 精品一区二区在线视频| 亚洲综合一二区| 国产精品久线在线观看| 欧美电视剧免费观看| 欧美r级电影在线观看| 日韩欧美国产综合| 欧美男男青年gay1069videost| 成人成人成人在线视频| 国产精品一区2区| 成人av网址在线| 成年人国产精品| 99久久国产综合精品女不卡| 国产成人福利片| 国产美女娇喘av呻吟久久| 国产99久久久久| 波多野结衣一区二区三区| a美女胸又www黄视频久久| www.日韩精品| 在线国产亚洲欧美| 精品人在线二区三区| 2023国产精华国产精品| 91精品国产免费| 精品国产免费一区二区三区香蕉| 精品理论电影在线观看| 欧美一级二级三级乱码| 欧美二区三区91| 欧美精品一区二区三| 国产婷婷色一区二区三区在线| 久久免费偷拍视频| 亚洲一卡二卡三卡四卡无卡久久 | 在线中文字幕一区| 91精品国产综合久久久久久| 欧美精品一区男女天堂| 亚洲高清在线视频| 久久综合综合久久综合| 91小视频免费观看| 日韩你懂的电影在线观看| 亚洲你懂的在线视频| 国产毛片一区二区| 欧美一区二区国产| 中文字幕一区二区视频| 亚洲国产美国国产综合一区二区| 国产精品夜夜爽| 91蜜桃在线观看| 久久精品人人做人人综合 | 成人小视频免费在线观看| 在线综合亚洲欧美在线视频| 亚洲免费观看高清完整版在线观看熊 | 一区二区三区四区视频精品免费 | a级精品国产片在线观看| 欧美一区二区三区系列电影| 国产精品理伦片| 粉嫩在线一区二区三区视频| 日韩欧美电影一区| 三级一区在线视频先锋| 成人国产在线观看| 久久精品夜色噜噜亚洲aⅴ| 日韩精品三区四区| 91精品国产综合久久精品图片 | 国产aⅴ精品一区二区三区色成熟| 欧亚洲嫩模精品一区三区| 香蕉久久夜色精品国产使用方法| av一区二区不卡| 国产欧美综合在线| 国产麻豆一精品一av一免费| 欧美挠脚心视频网站| 日本伊人色综合网| 精品久久一二三区| 久久国产夜色精品鲁鲁99| 欧美日韩视频在线第一区 | 日本三级亚洲精品| 91久久国产最好的精华液| 亚洲国产经典视频| 欧美亚日韩国产aⅴ精品中极品| 亚洲成av人片一区二区三区| 欧美不卡123| 国产精品一区三区| 亚洲色图.com| 91精品国产综合久久久久久久久久 | 日韩欧美综合在线| 成人精品视频一区二区三区尤物| 亚洲欧美日本韩国| 欧美精品一二三区| 国产高清久久久| 亚洲午夜私人影院| 欧美一区二区三区白人|