Merge Mertens taking much longer on C++ than on Python on same set of images
HI,
I have implemented an image enhancement technique that uses Merge Mertens. I have coded it in Python and C++. On same set of images of same size and dimensions, Merge Mertens takes less than 2 seconds on Python while taking 11 seconds on C++. I want my C++ code to be faster as I have to deploy it on android devices.
Moreover, I implemented my own basic unoptimized version of exposure fusion on both Python and C++. They were both taking almost the same amount of time as Merge Mertens took in their respective languages.
Is there any reason why this is happening? How could I achieve same time as Python on C++ as speed is necessary for me as I would be using this code for android.
The reason for this kind of problems is in 99% of cases a problem in the asker's code.
I myself thought that I must have made some silly mistake in my code. But I have checked multiple times and everything seems fine.
This is my code in Python
This is my code in C++
Here pme is list/vector of images. I have checked its size and displayed them using imshow before passing them to the function and they are the same. However there is still difference in time taken. I am using Python 3.5 and VS2017 for C++. I am using OpenCV 4.2.0 on both platforms.
this is disturbing. For my real-time application I put aside Python as an interpreted language in favour of compiled C++ Perhaps this executive decision was wrong?
How do you compile the code? You should compile using the RELEASE flag instead of DEBUG flag