mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #11706 from take1014:setTo_Nan_10507
* setTo_#10507 * setTo_Nan_10507 * setTo: update check / test for NaNs
This commit is contained in:
committed by
Alexander Alekhin
parent
ff3d4d8b7f
commit
4fe648b15c
@@ -463,9 +463,14 @@ static bool ipp_Mat_setTo_Mat(Mat &dst, Mat &_val, Mat &mask)
|
||||
return false;
|
||||
|
||||
if (dst.depth() == CV_32F)
|
||||
{
|
||||
for (int i = 0; i < (int)(_val.total()); i++)
|
||||
if (_val.at<double>(i) < iwTypeGetMin(ipp32f) || _val.at<double>(i) > iwTypeGetMax(ipp32f))
|
||||
{
|
||||
float v = (float)(_val.at<double>(i)); // cast to float
|
||||
if (cvIsNaN(v) || cvIsInf(v)) // accept finite numbers only
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(dst.dims <= 2)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user