Why do more when you can do less.
This has pretty much been my driving motivation, trying to optimize all my code to have the fastest runtime possible. Before when I was running ZS’s thinning algorithm I was reading straight from the Matrix using the CvMat get and put methods. I thought that maybe there was speed to be gained if before I converted my matrix into a two-dimentional integer array so I didn’t have to work with double values that the get and set methods provided. I’ll let the picture speak for itself.
The decrease was rediculous, and I still wonder; could it possibly be even optimized more? I’ll probably still play around with it and find out but I can definetly apply this to my A* algorithm.