0

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 Link

I've tried all of the different Tonemaps/Merges/Calibrates, and this gives me the best result, but it's obviously still...off.

api55
  • 11,070
  • 4
  • 41
  • 57
Nick Starr
  • 11
  • 2
  • Just to eliminate the obvious questions, did you tried different parameters AlingMTB and tonemap? have you tried with mergeMertens, just to see if it generates at least a good image? It is good if you share somehow the images used (and times), for other people test it and probably give you a better answer. – api55 Jan 10 '18 at 14:04
  • [Here](https://imgur.com/a/I1QbQ) is my set of images. They use EV's of -4.0 to 4.0 on an iPhone 8, which I believe I calculated the times out to 51.84, 25.92, 12.96, 6.48, 3.24, 1.62, 0.81, 0.405, 0.2025. I've spent a good bit of time playing around with parameters for AlignMTB and tonemapping, and nothing ever has looked great. I gave it a shot with mergeMertens, and it came out better (although oddly jaggy lines) but still not perfect. – Nick Starr Jan 10 '18 at 14:14

0 Answers0