经过昨天晚上的调试,发现了一个主要问题:使用圆网格标定板标定时,不能使用cornerSubPix()函数,否则寻找角点时,会导致图一的情况(裁剪为30万像素)。就找到能参考的程序,推进还是很快的。
图一
一些数据对比:
棋盘格:
30万像素:
RMS error reported by calibrateCamera: 0.0595766
全像素:
RMS error reported by calibrateCamera: 0.194288
RMS error reported by calibrateCamera: 0.194288
check camera calibrate result, it is 1
averageReprojectionErrors, it is 0.194287
我的圆网格图片:
调用cornerSubPix()接口,
RMS error reported by calibrateCamera: 5.45907
未调用cornerSubPix()接口,
RMS error reported by calibrateCamera: 0.187395
check camera calibrate result, it is 1
averageReprojectionErrors, it is 0.187397
机械臂姿态变化较大数据:
RMS error reported by calibrateCamera: 0.0557502
check camera calibrate result, it is 1
averageReprojectionErrors, it is 0.0557503
第1幅图像的旋转向量 Rodrigues :
[-0.22260957481393;
0.1711469503381653;
-0.3290508280729473]
第1幅图像的旋转矩阵:
[0.9322830277470885, 0.3001300983645228, 0.2019165179732041;
-0.337638649416289, 0.922308163787746, 0.1880100886410635;
-0.1298017665329163, -0.2434534351086017, 0.9611877685128729]
第1幅图像的平移向量:
[-76.45090666433144;
-13.574103850496;
434.3319646871819]
第2幅图像的旋转向量 Rodrigues :
[-0.1439470290365807;
-0.01668449089763162;
0.2466768023889751]
第2幅图像的旋转矩阵:
[0.9696439912038159, -0.2421328498501522, -0.03409125028181945;
0.2445181961817601, 0.9594923296042489, 0.1399475657760062;
-0.001175609778911589, -0.1440352472627967, 0.9895718596886195]
第2幅图像的平移向量:
[7.823904018403115;
-50.14423917119736;
453.4540216899545]
第3幅图像的旋转向量 Rodrigues :
[0.1622441852597525;
0.1859276514794853;
0.2367861820170687]
第3幅图像的旋转矩阵:
[0.9551215908890158, -0.2172609446135982, 0.2013465384933214;
0.2471337540807685, 0.9592045201131139, -0.1373011150301307;
-0.1633023398839765, 0.1808987853474367, 0.9698494600958647]
第3幅图像的平移向量:
[-0.2591095981902292;
-54.97726647214457;
446.0070665585101]
第4幅图像的旋转向量 Rodrigues :
[0.2382480453803298;
-0.2279683675221786;
0.7445192040707087]
第4幅图像的旋转矩阵:
[0.7132444199639519, -0.6906184913985651, -0.1197016989380512;
0.6392409050911947, 0.710977653233358, -0.2930560387724114;
0.2874951523912637, 0.1325023620210484, 0.9485724334020924]
第4幅图像的平移向量:
[28.44445433363878;
-49.18942620735547;
426.3713721031345]
第5幅图像的旋转向量 Rodrigues :
[0.3555109122278653;
0.04836697594420068;
-0.7670684387422099]
第5幅图像的旋转矩阵:
[0.7218678956797957, 0.6867157953797334, -0.08560465853447197;
-0.6705241309315337, 0.6634626773975407, -0.3319859417791634;
-0.171184494114785, 0.2970499824549174, 0.9393919186889987]
第5幅图像的平移向量:
[-63.35845591415084;
4.679880055433732;
435.3520363224943]
第6幅图像的旋转向量 Rodrigues :
[-0.3170829604794392;
0.02248091707007723;
-0.1109533159581862]
第6幅图像的旋转矩阵:
[0.9936522898734279, 0.105338314798874, 0.03948374684128364;
-0.1123995470466046, 0.9441048965366222, 0.3098907648822278;
-0.004633427782040341, -0.3123616233965168, 0.9499519711943765]
第6幅图像的平移向量:
[19.89376289731621;
-61.03257084438558;
474.4755553421036]
第7幅图像的旋转向量 Rodrigues :
[-0.3221267264819541;
-0.02002179585097706;
-0.4023731465409322]
第7幅图像的旋转矩阵:
[0.9206309648014804, 0.3879196535889378, 0.04423764243417244;
-0.3816118388631702, 0.87008440218237, 0.3119704112867397;
0.08252897120505615, -0.3040912288087018, 0.9490613749771133]
第7幅图像的平移向量:
[-90.30954876816227;
-6.705349668820628;
463.118835621722]
这些数据看着就挺正常的。下次把有问题的数据列下。
上面数据均未使用图片校准。
目前这个相机标定程序比较OK,至此棋盘格和圆网格两种标定板。有需要的同志可在公众号后台留言“改进的相机标定程序”。
上一篇手眼标定问题排查:
手眼标定问题排查_1_棋盘格相机内参标定姿态数据