mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
triangle weights bug fixed and ldr ground truth updated
This commit is contained in:
parent
cd0699a338
commit
3891d32f58
Binary file not shown.
Before Width: | Height: | Size: 560 KiB After Width: | Height: | Size: 535 KiB |
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user