Performance - Add and subtract, saving memory operations

asked 2018-10-18 04:20:46 -0600

NadavB gravatar image

I have 3 matrices: A,B,C. I want to add A to C (save in C), and then subtract B from C (save in C) Now I do it with two commands: add (or accumulate), and then subtract

I think that I can save memory load (assembly) operations if I do it in some custom way. If I do it in one loop, I can load the C register only once, instead of twice as I do it today. Is there an OPENCV operation for add+subtract, or should I write it myself? If you have tips for doing it, it will be highly appreciable.

edit retag flag offensive close merge delete