Vous êtes sur la page 1sur 2

STEPS TO INTEGRATE OPENCV 2.

2 WITH VISUAL STUDIO 2010:

1. Install VISUAL STUDIO 2010 and OPENCV 2.2. 2. Open VISUAL STUDIO 2010 and on the Start Page window that appears click on New Project button. 3. In the New Project window, select the Win32 Console Application and give a desired project name and location in the Name: and Location: tab below the window and click on OK button. 4. In the Win32 Application Wizard-dsd window that appears click on Next > and Finish. 5. Now the command window for writing codes appears with #include stdafx.h header file and main( ) function already declared. 6. However, when you try writing the OPENCV codes and functions they get underlined with red signifying them as the errors. To nullify these errors we have to include the include and lib directories of OPENCV to the project. 7. At the bottom left corner of the screen there are four tabs namely Solution Explorer, Class View, Property Manager, Team Explorer. 8. Click on the Property Manager tab. Right-click on the project name that is visible in the Property Manager window and select Add New Project Property Sheet. In the Add New Item window that opens give a name to the property sheet in the Name: tab and leave the Location: tab as it is. Click on Add button. 9. Click on the arrow on the left of the project name and then the arrow under the Debug|Win32 folder. 10. Right-click on the project name under the Debug|Win32 folder and select Properties. 11. In the def Property Pages window that appears, click on the arrow of C/C++ and under it select General. Then select Additional Include Directories and in the drop down arrow select <Edit>. In the Additional Include Directories window that appears, click on the New Line button (a button having a folder symbol). Click on the button and give the path for the include directory of OPENCV and

click on Select Folder button, then OK button and then Apply button. 12. In the def Property Pages window, click on the arrow of Linker and under it select General. Then select Additional Library Directories and in the drop down arrow select <Edit>. In the Additional Library Directories window that appears, click on the New Line button. Click on the button and give the path for the lib directory of OPENCV and click on Select Folder button, then OK button and then Apply button. 13. Again, under Linker select Input. Then select Additional Dependencies and in the drop down arrow select <Edit>. In the Additional Dependencies window that appears, copy and paste all the list of the file names with extension as filename.lib in lib folder of OPENCV. Click on OK button, then Apply button and then OK button. [Note: It is better to keep all the list of filenames.lib in a text document for the ease of copying and pasting them at times of need] 14. Now the codes and functions of OPENCV can be written and executed using VISUAL STUDIO 2010.

Vous aimerez peut-être aussi