以下のコードを使用して、異なる露出値で撮影された 3 つの画像を使用して HDR 画像を作成しようとしています。使用する IDE は Visual Studio 2013 です。
#include <opencv2/photo.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int, char** argv)
{
vector<Mat> images;
vector<float> times;
// Load images and exposures...
Mat img1 = imread("C:\\Users\\Prashant\\Documents\\Visual Studio 2013\\Projects\\OpenCVProject3\\mem0.png");
if (img1.empty())
{
cout << "Error! Input image cannot be read...\n";
return -1;
}
Mat img2 = imread("C:\\Users\\Prashant\\Documents\\Visual Studio 2013\\Projects\\OpenCVProject3\\mem1.png");
Mat img3 = imread("C:\\Users\\Prashant\\Documents\\Visual Studio 2013\\Projects\\OpenCVProject3\\mem2.png");
images.push_back(img1);
images.push_back(img2);
images.push_back(img3);
times.push_back((float)1 / 66);
times.push_back((float)1 / 32);
times.push_back((float)1 / 12);
// Estimate camera response...
Mat response;
Ptr<CalibrateDebevec> calibrate = createCalibrateDebevec();
calibrate->process(images, response, times);
// Show the estimated camera response function...
cout << response;
// Create and write the HDR image...
Mat hdr;
Ptr<MergeDebevec> merge_debevec = createMergeDebevec();
merge_debevec->process(images, hdr, times, response);
imwrite("hdr.hdr", hdr);
cout << "\nDone. Press any key to exit...\n";
waitKey(); // Wait for key press
return 0;
}
コードを実行すると、次のエラーが表示されます。
OpenCVProject3.exe の 0x00007FFFC90FA1C8 で未処理の例外: Microsoft C++ 例外: cv::Exception メモリ位置 0x000000B170C3E630。
正確な問題は何ですか?