triangle weights bug fixed and ldr ground truth updated

This commit is contained in:
Abhishek Gola 2025-06-02 15:58:45 +05:30
parent cd0699a338
commit 3891d32f58
4 changed files with 9 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 KiB

After

Width:  |  Height:  |  Size: 535 KiB

View File

@ -65,10 +65,15 @@ Mat triangleWeights()
Mat w(LDR_SIZE, 1, CV_32F);
int half = LDR_SIZE / 2;
int maxVal = LDR_SIZE - 1;
for (int i = 0; i < LDR_SIZE; i++)
w.at<float>(i) = (i < half)
float epsilon = 1e-6f;
for (int i = 0; i < LDR_SIZE; i++){
float val = (i < half)
? static_cast<float>(i)
: static_cast<float>(maxVal - i);
if (val < epsilon)
val = epsilon;
w.at<float>(i) = val;
}
return w;
}

View File

@ -65,6 +65,7 @@ public:
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
max(src, Scalar::all(1e-6), src);
CV_Assert(!src.empty());
CV_Assert(_src.dims() == 2 && _src.type() == CV_32FC3);
_dst.create(src.size(), CV_32FC3);

View File

@ -40,7 +40,7 @@ hdr = merge_debevec.process(images, times, response)
## [Make HDR image]
## [Tonemap HDR image]
tonemap = cv.createTonemap(2.2)
tonemap = cv.createTonemapDrago(2.2)
ldr = tonemap.process(hdr)
## [Tonemap HDR image]