在OpenCV中创建HDR图像时出现未处理的异常

时间:2016-04-10 14:08:34

标签: c# c++ opencv hdrimages

使用下面的代码,我尝试使用以不同曝光值拍摄的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 ::内存位置0x000000B170C3E630处的异常。

确切的问题是什么?

0 个答案:

没有答案