Please read Open CV documentation:
http://docs.opencv.org/modules/core/doc/old_basic_structures.html[
^],
http://docs.opencv.org[
^].
The question is not very productive. It's pretty apparent that you are asking on the code which you did not write by yourself. Why trying to dig in it if you did not understand the documentation of the function or the library? You need try to understand it from documentation and then write your own code. Even if you fail to make it working, it will give you a lot more understanding; and then you can ask the question showing your code. At least you will be able to explain what did you try and why, and that could provide a clue for the answering or giving you an advice on how to do it correctly.
—SA