Ask Your Question

Revision history [back]

OpenCV on iOS producing milky/off-colored hdr images?

I'm trying to get OpenCV to produce hdr images on iOS with 9 pictures that I've supplied it (-4.0 to 4.0 EV's, increment of 1), but the pictures are coming out looking off. Everything has this weird milky filter look to it, and outside the window looks blue and pixelated. Any insight as to why this result could be happening? Below is my code as well as an image showing what issue I'm having.

cv::Mat mergeToHDR (vector<Mat>& images, vector<float>& times)
{
imgs = images;
Mat response;
vector<Mat> images_(images);
Ptr<AlignMTB> align=createAlignMTB(4);// 4=max 16 pixel shift
align->process(images_, images);


Ptr<CalibrateDebevec> calibrate = createCalibrateDebevec();
calibrate->process(images, response, times);

Mat hdr;
Ptr<MergeDebevec> merge = createMergeDebevec();
merge->process(images, hdr, times, response);

Mat tm;
Ptr<TonemapReinhard> tonemap = createTonemapReinhard(2.2f);
tonemap->process(hdr, tm);
tm = tm * 255;
tm.convertTo(tm, CV_8U);
return tm;
}

Image