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.



Tags: ,

About jjyap

I'm an undergraduate student at Simon Fraser University. A lot of the fun projects and research that I work on are Computer Vision and Machine Learning related.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: