Hello! I have a question. Why opencv for visual studio works almost 2 times faster than opencv for (mingw gcc)? How to fix it?
The same code. Windows 7 x64; Intel Core i7-3612QM CPU 2.10 GHz (4 kernels 8 streams); RAM 8Gb; First example. VS 2017 OpenCV 3.4.0; Windows SDK version 10.0.16299.0 to target Windows 6.1.7601; The C compiler identification is MSVC 19.13.26131.1 Second example. The C compiler identification is GNU 7.3.0; Check for working C compiler: C: /msys64/mingw64/bin/gcc.exe; Found OpenCV: C: / msys64 / mingw64 (found version "3.4.0") In first example: time work for cv::matchTemplate(scene, img_templ, corr, CV_TM_CCORR_NORMED) ~= 0.6-0,7 s. In second example: time work for cv::matchTemplate(scene, img_templ, corr, CV_TM_CCORR_NORMED) ~= 1.1~1,4 s. I don't understand. Why is it different time? How does it fix?
there are no facts in your question.
unless you point us at a specific situation (and come up with a reproducable example and numbers) -- we cannot help you.
The same code. Windows 7 x64; Intel Core i7-3612QM CPU 2.10 GHz (4 kernels 8 streams); RAM 8Gb; First example. VS 2017 OpenCV 3.4.0; Windows SDK version 10.0.16299.0 to target Windows 6.1.7601; The C compiler identification is MSVC 19.13.26131.1 Second example. The C compiler identification is GNU 7.3.0; Check for working C compiler: C: /msys64/mingw64/bin/gcc.exe; Found OpenCV: C: / msys64 / mingw64 (found version "3.4.0") In first example: time work for cv::matchTemplate(scene, img_templ, corr, CV_TM_CCORR_NORMED) ~= 0.6-0,7 s. In second example: time work for cv::matchTemplate(scene, img_templ, corr, CV_TM_CCORR_NORMED) ~= 1.1~1,4 s. I don't understand. Why is it different time? How does it fix?
OpenCV includes a subset of Intel IPP. Probably with Visual Studio it is the IPP variant that is called.
OpenCV IPP is available on Windows, Mac and Linux. On Windows platform you should stick with Visual Studio in my opinion.
@Eduardo , indeed, it is so (there is an ipp version for matchTemplate). and mingw can't link to ipp.
Thanks Eduardo. But I must use MinGW.