Update contrast_preserve.hpp

fix a build warning:

```
C:\Slave\workspace\precommit\windows10\opencv\modules\photo\src\contrast_preserve.hpp(289): warning C4244: '=': conversion from 'double' to '_Tp', possible loss of data
        with
        [
            _Tp=float
        ]
C:\Slave\workspace\precommit\windows10\opencv\modules\photo\src\contrast_preserve.hpp(361): warning C4244: '=': conversion from 'double' to '_Tp', possible loss of data
        with
        [
            _Tp=float
        ]
```

(from https://build.opencv.org.cn/job/precommit/job/windows10/1633/console)
pull/19944/head
berak 4 years ago committed by GitHub
parent 6598e9d506
commit 405e820fe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      modules/photo/src/contrast_preserve.hpp

@ -285,9 +285,9 @@ void Decolor::grad_system(const Mat &im, vector < vector < double > > &polyGrad,
add_vector(comb,idx,r,g,b);
for(int i = 0;i<h;i++)
for(int j=0;j<w;j++)
curIm.at<float>(i,j)=
curIm.at<float>(i,j)=static_cast<float>(
pow(rgb_channel[2].at<float>(i,j),r)*pow(rgb_channel[1].at<float>(i,j),g)*
pow(rgb_channel[0].at<float>(i,j),b);
pow(rgb_channel[0].at<float>(i,j),b));
vector <double> curGrad;
gradvector(curIm,curGrad);
add_to_vector_poly(polyGrad,curGrad,idx1);

Loading…
Cancel
Save