2016-04-01 09:36:50 -0600 | received badge | ● Editor (source) |
2016-04-01 06:28:36 -0600 | asked a question | OpenCV optimisation - multiplying a set of matrices by a set of scalars and summing. I have an optimisation problem and I'm wondering what the best way to approach the problem is. At present I have a set of matrices (mats) that I need to scale by a set of values held in a vector and then summed together. I have written the following code nut it seems to be pretty painfully slow (far more so than I would have thought). Can anyone suggest a faster way of doing the above loop? Edit: I wrote a little function to try and aid my performance: This is about 8 times faster when multi-threaded than the original code. Can anyone explain what is going on? |