opencv/modules
Abhishek Gola aef6ae4872
Merge pull request #27396 from abhishek-gola:hdr_bug_fix
Fix NaNs in HDR Triangle Weights and Tonemapping and Update LDR Ground Truth in tutorial #27396

The PR closes #27392 

Updated the triangle weights to use a small epsilon value instead of zero to prevent NaN issues in HDR processing.
Also fixed a float-to-double division issue by explicitly casting double values to float, which was previously producing garbage values and leading to NaNs in tonemapping.

The current LDR ground truth image used in the tutorial [ldr.png](https://github.com/opencv/opencv/blob/4.x/doc/tutorials/others/images/ldr.png) was originally generated using TonemapDurand (check this commit 833f8d16fa), which was moved to opencv_contrib a long time ago in this commit: 742f22c09b. However, the current Tonemap implementation in OpenCV main only performs normalization and gamma correction, which produces noticeably different results. This PR updates the LDR grouth truth image in tutorial with the result of TonemapDrago, and tutorials to use TonemapDrago as Tonemap gives a darker image.

Tonemap output:
![ldr2](https://github.com/user-attachments/assets/e4f0cb97-ee4f-47b9-8962-2020ff211fd5)

TonemapDrago output:
![ldr](https://github.com/user-attachments/assets/4a898101-22bd-49e5-8db0-9e1062974ba3)


### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-06-05 09:02:58 +03:00
..
calib3d Merge pull request #27338 from omahs:patch-1 2025-05-21 12:13:50 +03:00
core Merge pull request #27346 from asmorkalov:as/ipp_hal_sum 2025-05-24 16:53:42 +03:00
dnn Merge pull request #27363 from MRo47:openvino-npu-support 2025-05-27 14:13:49 +03:00
features2d Enable Java bindings for SimpleBlobDetector::blobColor 2025-04-20 15:57:41 +09:00
flann flann: remove unused hdf5 header 2024-11-14 19:44:10 +03:00
gapi Merge pull request #27355 from asmorkalov:as/gapi_control_msmf 2025-06-04 16:30:50 +03:00
highgui Fixed QT window resize logic. 2025-05-05 14:52:15 +03:00
imgcodecs Merge pull request #27384 from Kumataro:fix27382 2025-06-02 11:23:38 +03:00
imgproc Merge pull request #27398 from asmorkalov:as/relax_remap_relative 2025-06-04 16:29:21 +03:00
java feat: add conditional inclusion support to header parser 2025-05-19 10:11:52 +03:00
js Fixed bug in ifdef state machine in header parser for bindings. 2025-06-02 12:41:39 +03:00
ml Merge pull request #27338 from omahs:patch-1 2025-05-21 12:13:50 +03:00
objc feat: add conditional inclusion support to header parser 2025-05-19 10:11:52 +03:00
objdetect Merge pull request #27228 from utibenkei:fix_java_enum_wrapper 2025-04-21 20:51:38 +03:00
photo Merge pull request #27396 from abhishek-gola:hdr_bug_fix 2025-06-05 09:02:58 +03:00
python Fixed bug in ifdef state machine in header parser for bindings. 2025-06-02 12:41:39 +03:00
stitching Merge pull request #26754 from s-trinh:add_bibtex_direct_pdf_links 2025-01-27 10:28:38 +03:00
ts fix: qnx7.0 build 2025-02-27 14:24:18 +08:00
video Merge pull request #25027 from opencv-pushbot:gitee/alalek/tests_filter_debug 2025-03-21 10:22:17 +03:00
videoio Merge pull request #27338 from omahs:patch-1 2025-05-21 12:13:50 +03:00
world cmake: use /INCREMENTAL:NO with MSVS 2015 2023-12-07 19:46:27 +00:00