File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11#include " opencv.hpp"
2- #include " tone_mapping.hpp"
32
43#include < stdbool.h>
5- #include < cstdio>
6- #include < memory>
74#include < opencv2/highgui.hpp>
85#include < opencv2/imgproc.hpp>
96#include < jpeglib.h>
107#include < png.h>
118#include < setjmp.h>
129#include < iostream>
13- #include < lcms2.h>
1410
1511// Interpolation constants
1612const int CV_INTER_AREA = cv::INTER_AREA;
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ cv::Mat* apply_hdr_to_sdr_tone_mapping(
2323 }
2424
2525 // Load ICC profile
26+ // NOTE: it may not be reliable to use just the icc profile for detecting HDR. some formats contain
27+ // flags and not profiles, but going to go with this for a first pass
2628 cmsHPROFILE src_profile = cmsOpenProfileFromMem (icc_data, icc_len);
2729 if (!src_profile) {
2830 return nullptr ;
@@ -65,6 +67,8 @@ cv::Mat* apply_hdr_to_sdr_tone_mapping(
6567 }
6668
6769 // Apply Reinhard tone mapping
70+ // Tried to use OpenCV's built in tone mapping, but ran into issues with
71+ // dimming blown out/deep fried images. Using this as a first pass
6872 std::unique_ptr<cv::Mat> dst_bgr = std::make_unique<cv::Mat>(src_for_transform->rows , src_for_transform->cols , CV_8UC3);
6973
7074 // Apply luminance-based tone mapping to preserve color relationships
You can’t perform that action at this time.
0 commit comments