OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Sun, 16 Sep 2018 14:50:54 -0500Is reading / writing a pixel slower than simple CPU operations (like addition)?http://answers.opencv.org/question/199525/is-reading-writing-a-pixel-slower-than-simple-cpu-operations-like-addition/I'm trying to do complexity analysis on an algorithm that only has a couple of nested loops.
Traditional rule of thumb would be considering this a **O(n*n)** case (n number of pixels), but if I consider that reading and writing single pixel values is a more expensive operation than simple addition and subtraction of integers, the algorithm becomes **O(n)** for the number of non-empty pixels.
Is reading / writing a single pixel a much more complex operation than simple CPU-optimised operations like addition, subtraction, comparisons and assignment?
*(Appending the algorithm in case someone needs specific details)*
![image description](/upfiles/15371275708274099.png)DanyAlejandroSun, 16 Sep 2018 14:50:54 -0500http://answers.opencv.org/question/199525/Where can I find the computational complexity of the algorithms?http://answers.opencv.org/question/76493/where-can-i-find-the-computational-complexity-of-the-algorithms/ Hi,
I wanted to know if there is a place where I can find the computational complexity (Big-O notation) of the algorithms implemented in opencv?
In particular the methods used for [template matching](http://docs.opencv.org/3.0.0/df/dfb/group__imgproc__object.html#ga3a7850640f1fe1f58fe91a2d7583695d) and for shape trasformation using the class
[ThinPlateSplineShapeTransformer](http://docs.opencv.org/3.0.0/dc/d18/classcv_1_1ThinPlateSplineShapeTransformer.html#details)cata_rayTue, 17 Nov 2015 05:38:53 -0600http://answers.opencv.org/question/76493/