opencv でカメラ キャリブレーションのサンプル コードを見ています。
今、コードのいくつかの行を理解するのに苦労しています。このコードは、Opencv 2.4.3 のサンプル コード フォルダーにあります。
私の質問は、opencv ではなく C++ に関するものです。
これがopencvのサンプルコードです。
if( !rvecs.empty() && !tvecs.empty() )
{
CV_Assert(rvecs[0].type() == tvecs[0].type());
Mat bigmat((int)rvecs.size(), 6, rvecs[0].type());
for( int i = 0; i < (int)rvecs.size(); i++ )
{
Mat r = bigmat(Range(i, i+1), Range(0,3));
Mat t = bigmat(Range(i, i+1), Range(3,6));
CV_Assert(rvecs[i].rows == 3 && rvecs[i].cols == 1);
CV_Assert(tvecs[i].rows == 3 && tvecs[i].cols == 1);
//*.t() is MatExpr (not Mat) so we can use assignment operator
r = rvecs[i].t();
t = tvecs[i].t();
}
cvWriteComment( *fs, "a set of 6-tuples (rotation vector + translation vector) for each view", 0 );
fs << "Extrinsic_Parameters" << bigmat;
私の質問は、データが「ビッグマット」にどのように配置されるかです。変数に値を設定するには、'bigmat' を右側に配置する必要がありますが、そうではありません。
この種のコードに詳しい人はいますか? 助けて。
ありがとう