0

使用下面的代码,我正在尝试使用 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++ 异常:内存位置 0x000000B170C3E630 处的 cv::Exception。

确切的问题是什么?

4

0 回答 0