私は現在、opencv2.3 と Pointgrey Bumblebee2 ステレオカメラを入力デバイスとして使用して、ステレオ処理に取り組んでいます。イメージの取得は、libdc1394を介して行われます。
整流とステレオ処理の私のコードは次のとおりです。
void StereoProcessing::calculateDisparityMap(const Mat &left, const Mat &right, Mat &disparity_map)
Mat map11, map12, map21, map22, left_rectified, right_rectified, disp16;
// Computes the undistortion and rectification transformation maps
initUndistortRectifyMap(this->camera_matrix1,
this->distance_coefficients1,
this->R1,
this->P1,
this->output_image_size,
CV_16SC2,
map11,
map12);
initUndistortRectifyMap(this->camera_matrix2,
this->distance_coefficients2,
this->R2,
this->P2,
this->output_image_size,
CV_16SC2,
map21,
map22);
// creates rectified images
remap(left, left_rectified, map11, map12, INTER_LINEAR);
remap(right, right_rectified, map21, map22, INTER_LINEAR);
// calculates 16-bit disparitymap
this->stereo_bm(left_temp, right_temp, disp16);
disp16.convertTo(disparity_map, CV_8U, 255 / (this->stereo_bm.state->numberOfDisparities * 16.0));
}
これは、視差マップの黒い左の境界線を除いて正常に機能します。これは次のとおりです。
入力画像はこれら 2 つで、ご覧のとおり修正されていません ;) :
だから私の質問は今です:これは正常な動作ですか? または、これまでに行った間違いが見られますか? 別の情報として、整流は正常に機能します