mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +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);
|
Mat w(LDR_SIZE, 1, CV_32F);
|
||||||
int half = LDR_SIZE / 2;
|
int half = LDR_SIZE / 2;
|
||||||
int maxVal = LDR_SIZE - 1;
|
int maxVal = LDR_SIZE - 1;
|
||||||
for (int i = 0; i < LDR_SIZE; i++)
|
float epsilon = 1e-6f;
|
||||||
w.at<float>(i) = (i < half)
|
for (int i = 0; i < LDR_SIZE; i++){
|
||||||
|
float val = (i < half)
|
||||||
? static_cast<float>(i)
|
? static_cast<float>(i)
|
||||||
: static_cast<float>(maxVal - i);
|
: static_cast<float>(maxVal - i);
|
||||||
|
if (val < epsilon)
|
||||||
|
val = epsilon;
|
||||||
|
w.at<float>(i) = val;
|
||||||
|
}
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ public:
|
|||||||
CV_INSTRUMENT_REGION();
|
CV_INSTRUMENT_REGION();
|
||||||
|
|
||||||
Mat src = _src.getMat();
|
Mat src = _src.getMat();
|
||||||
|
max(src, Scalar::all(1e-6), src);
|
||||||
CV_Assert(!src.empty());
|
CV_Assert(!src.empty());
|
||||||
CV_Assert(_src.dims() == 2 && _src.type() == CV_32FC3);
|
CV_Assert(_src.dims() == 2 && _src.type() == CV_32FC3);
|
||||||
_dst.create(src.size(), CV_32FC3);
|
_dst.create(src.size(), CV_32FC3);
|
||||||
|
@ -40,7 +40,7 @@ hdr = merge_debevec.process(images, times, response)
|
|||||||
## [Make HDR image]
|
## [Make HDR image]
|
||||||
|
|
||||||
## [Tonemap HDR image]
|
## [Tonemap HDR image]
|
||||||
tonemap = cv.createTonemap(2.2)
|
tonemap = cv.createTonemapDrago(2.2)
|
||||||
ldr = tonemap.process(hdr)
|
ldr = tonemap.process(hdr)
|
||||||
## [Tonemap HDR image]
|
## [Tonemap HDR image]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user