@kbw:
The forums does not permit me to attach file, so I cannot upload the whole project files. But if you have OpenCV in your machine, you can create an empty project, add this code to the project, add opencv references to include and library directory in the project properties and you can run and investigate the code.
If you have the time, please help me !
Thank you.
@kbw: You create an empty project in VC10. (Choose File\New\Project, then choose Visual C++\General\Empty Project). You copy the code, save to .cpp file and add this file to the project.