answered 2015-06-08 23:49:09 -0600
You may want to take a look at the examples provided with opencv. Please check the following page