【OpenCV】 パノラマ画像を作成する
OpenCVの復習が必要になったのでメモしておきます。
// 画像を読み込む UMat source1; imread("scene1.jpg", CV_LOAD_IMAGE_COLOR).copyTo(source1); if (source1.empty()) { throw runtime_error("Failed to open image"); } UMat source2; imread("scene2.jpg", CV_LOAD_IMAGE_COLOR).copyTo(source2); if (source2.empty()) { throw runtime_error("Failed to open image"); } vector<UMat> sources; sources.push_back(source1); sources.push_back(source2); // パノラマ画像を作成する Stitcher stitcher = Stitcher::createDefault(); UMat destination; Stitcher::Status status = stitcher.stitch(sources, destination); if (status != Stitcher::OK) { throw runtime_error("Failed to stitch images"); } imshow("source1", source1); imshow("source2", source2); imshow("destination", destination);
さらに進化した画像処理ライブラリの定番 OpenCV 3基本プログラミング
- 作者: 北山洋幸
- 出版社/メーカー: カットシステム
- 発売日: 2016/04
- メディア: 単行本
- この商品を含むブログ (1件) を見る