Hello again,
Now I have examined this a bit further.
-
I downloaded the 4.5.2 sources and compiled it to a dynamic library using the cmake gui app (I followed point (7) under Building the library from here: OpenCV: Installation in Windows but only built the core and imgproc dlls). I then created a fresh Solution in Visual Studio with a single C++ project and used your code, but I still got the wrong result from cv::mean() (-1.54868e+08).
-
I downloaded the pre-built 4.5.2 dlls from here: Download OpenCV from SourceForge.net and updated the C++ project I created in step (1) to use that dll (opencv_world452d.lib in vc15/) but I still get the wrong result from cv::mean() (-1.54868e+08).
So it sounds unlikely that the error comes from the build environment (or the OpenCV source since your build does not reproduce the error).