Setup OpenCV in Visual Studio 2022 for C/C++ Development

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this video i will show you how to set up the opencv library in visual studio 2022 to create c plus applications so first let's download this library so let's type opencv then let's go to this first link in this page we have to click on library then releases now here we can download this latest version and i will download the version for windows now i need to save this file but in my case i have already downloaded it so i will cancel this download so this is the file that i have downloaded i have just run it so this file is an archive and we need to extract it so we need to provide the location where to extract it so i want to extract it into the folder called documents into a folder called libraries let's click on ok and then we need to extract it but in my case i have already extracted it so i will cancel this operation now let's go to the folder that contains opencv it is on documents then libraries and this is the obtained folder now we need to add the bin folder of opencv to the system environment variables because it contains some dll files that should be available for the application so let's go to build then x64 then vc15 and then bin now let's copy this path then let's go to system then advanced system settings and here let's click on environment variables then here we have to find the path variable so this is the path variable and we need to edit it so at the beginning of this field i will paste the path to provide it with the highest priority also i will add a semicolon as the separator between the different values now let's click on ok then ok ok again and let's close this window now let's go to visual studio and let's create a new project so here i will select mtc plus project then let's click on next for the name i will call it opencv project1 then let's click on create now the project has been created but it is empty so let's create a new c plus plus file here let's select c file and let's call it main.cpp then i will paste a source code that i have already prepared and you can find it in the description of this video so in this application we will open this image and we will create a window then we will paint the image in this window and we will put this window at this location and when the user presses any key we will terminate the application now i will show you how to build the release version of this application so let's go to project then properties and here for the configuration let's select release and for the platform let's select x64 now let's expand cc plus then let's select general and let's add the include folder of opencv so in the additional include directories we need to provide the include folder let's go to documents then libraries then open cv then build and let's select this include folder let's click on select folder then let's click on ok now let's go to linker then general then additional library directories then let's go to documents then libraries then opencv then build then x64 then vc15 now let's select this leap folder and let's click on select folder then ok then let's go to input and here we need to add the leap files of opencv now let's go to the folder that contains the lib files so let's go to build then x64 then vc15 then lib so to build the release version of the application we need to add this sleep file but to create the debug version of the application then we need to add this second lib file because i want to show you how to create the release version i will use this sleep file so let's copy its name and let's paste it here let's click on ok then ok now let's modify the version of the application and here let's select release then let's save this file and let's build the application so here we can see that the application has been built successfully now let's run the application but here we obtain this error so we need just to restart visual studio so let's open the previous project and let's run the application again and you obtain this window i hope that this video was helpful thank you for watching and please subscribe to the channel
Info
Channel: BoostMyTool
Views: 67,822
Rating: undefined out of 5
Keywords:
Id: unSce_GPwto
Channel Id: undefined
Length: 6min 41sec (401 seconds)
Published: Sat Jan 01 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.