Answer the question
In order to leave comments, you need to log in
What can replace the OpenCV functions absdiff and summ?
Good day!
I'm trying to optimize program performance using OpenCV, C++, MinGW.
The problem is that the absdiff function is now taking a very long time (400 milliseconds).
Before applying Mat to it, I cut them by ROI in order to reduce the size of the arrays, but I don’t know how to improve further.
The task itself is to find how much one picture differs from the other, in order to find the least different pair in the future.
Maybe there are faster ways, but without loss of accuracy?
Answer the question
In order to leave comments, you need to log in
absdiff in OpenCV is quite efficient. What you want is folding - calculating a smaller snippet while amplifying the differences of interest. In the simplest case, the usual size reduction is 2-4 times.
I don't think this is a problem with OpenCV, because such things are usually very well optimized. Here, most likely, the algorithm simply does not work very efficiently. It's hard to say for sure without code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question