From 2f22bdf477489a79d52699e01e42e489db2d4572 Mon Sep 17 00:00:00 2001 From: abhijeetraj10-web Date: Wed, 5 Nov 2025 17:12:12 +0530 Subject: [PATCH] Merge pull request #27959 from abhijeetraj10-web:fix-patchNaNs-doc Clarified supported types in cv::patchNaNs() documentation #27959 ### 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 - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake Updated the docs for cv::patchNaNs() to specify that both CV_32F and CV_64F types are supported. Fixes incomplete information. --- modules/core/include/opencv2/core.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/core/include/opencv2/core.hpp b/modules/core/include/opencv2/core.hpp index 7f73c71388..e3836523d5 100644 --- a/modules/core/include/opencv2/core.hpp +++ b/modules/core/include/opencv2/core.hpp @@ -1711,10 +1711,13 @@ elements. */ CV_EXPORTS_W bool checkRange(InputArray a, bool quiet = true, CV_OUT Point* pos = 0, double minVal = -DBL_MAX, double maxVal = DBL_MAX); +/** @brief Replaces NaNs (Not-a-Number values) in a matrix with the specified value. -/** @brief Replaces NaNs by given number -@param a input/output matrix (CV_32F type). -@param val value to convert the NaNs +This function modifies the input matrix in-place. +The input matrix must be of type `CV_32F` or `CV_64F`; other types are not supported. + +@param a Input/output matrix (CV_32F or CV_64F type). +@param val Value used to replace NaNs (defaults to 0). */ CV_EXPORTS_W void patchNaNs(InputOutputArray a, double val = 0);