tonemap result black image

asked 2020-07-22 12:00:47 -0600

Hello,

I try to implement the Reinhard tonemaper. I want to convert one float array fill with HDR values by components so my code is this :

cv::Mat imageHdr(cv::Size2i(_width, _height), CV_64FC3, (float*)_pixelsHdr);
imageHdr.convertTo(imageHdr, CV_32FC3);
cv::Ptr<cv::TonemapReinhard> reinhardTonemaper = cv::createTonemapReinhard(2.2f,0.f,0.f,0.f);

reinhardTonemaper->process(imageHdr, _imageLdr);
_imageLdr = _imageLdr * 255;
_imageLdr.convertTo(_imageLdr, CV_8UC3);

But the result is an image completly black while when I put directly the imageHdr to _imageLdr (it is cv:Mat objet too) the image looks like good.

Do you have any ideas about How I can find the problem and resolve it ?

Thanks for the help :)

edit retag flag offensive close merge delete