Step-by-Step Guide: Installing OpenCV C++ and Setting It Up in Visual Studio Code with CMake

  Рет қаралды 111,341

Nicolai Nielsen

Nicolai Nielsen

Күн бұрын

Inside my school and program, I teach you my system to become an AI engineer or freelancer. Life-time access, personal help by me and I will show you exactly how I went from below average student to making $250/hr. Join the High Earner AI Career Program here 👉 www.nicolai-nielsen.com/aicareer (PRICES WILL INCREASE SOON)
You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇
_____________________________________________________________
In this video 📝 I'm going to show you How To Install OpenCV C++ and Set It Up in Visual Studio Code with CMake. We will go over the installation of OpenCV and CMake. After that, we will open up Visual Studio Code and install the extensions we are going to use. We will then use CMake to configure our project and build it with OpenCV.
*********************************************
REMEMBER TO DOWNLOAD: visual studio 2019 with c++ devolvement tool
*********************************************
The Main file and the CMakeLists file are available on my GitHub: github.com/niconielsen32/Comp...
- You can just copy everything from those files and set it up as in the video and you are ready to create your OpenCV programs in Visual Studio Code with c++
OpenCV Download: opencv.org/releases/
CMake Download: cmake.org/download/
If you enjoyed this video, be sure to press the 👍 button so that I know what content you guys like to see.
_____________________________________________________________
🛠️ Freelance Work: www.nicolai-nielsen.com/nncode
_____________________________________________________________
💻💰🛠️ High Earner AI Career Program: www.nicolai-nielsen.com/aicareer
🇦🇪 Want to move to Dubai and get Visa? - Book a free consultation: www.genzoneconsulting.com/mee...
⚙️ Real-world AI Technical Courses: (www.nicos-school.com)
📗 OpenCV GPU in Python: www.nicos-school.com/p/opencv...
📕 YOLOv7 Object Detection: www.nicos-school.com/p/yolov7...
📒 Transformer & Segmentation: www.nicos-school.com/p/transf...
📙 YOLOv8 Object Tracking: www.nicos-school.com/p/yolov8...
📘 Research Paper Implementation: www.nicos-school.com/p/resear...
📔 CustomGPT: www.nicos-school.com/p/custom...
_____________________________________________________________
📞 Connect with Me:
🌳 linktr.ee/nicolainielsen
🌍 My Website: www.nicolai-nielsen.com/
🤖 GitHub: github.com/niconielsen32
👉 LinkedIn: / nicolaiai
🐦 X/Twitter: / nielsencv_ai
🌆 Instagram: / nicolaihoeirup
_____________________________________________________________
🎮 My Gear (Affiliate links):
💻 Laptop: amzn.to/49LJkTW
🖥️ Desktop PC:
NVIDIA RTX 4090 24GB: amzn.to/3Uc7yAM
Intel I9-14900K: amzn.to/3W4Z5Cb
Motherboard: amzn.to/4aR6wBC
32GB RAM: amzn.to/3Jt2XVR
🖥️ Monitor: amzn.to/4aLP8hh
🖱️ Mouse: amzn.to/3W501GH
⌨️ Keyboard: amzn.to/3xUGz5b
🎙️ Microphone: amzn.to/3w1F1WK
📷 Camera: amzn.to/4b4Ryr9
_____________________________________________________________
Timestamps:
0:00 Intallation
2:15 Setup
8:12 CMAKE Configuration
11:48 Test
Tags:
#OpenCV #VisualStudioCode #OpenCVInstall #OpenCVSetup #OpenCVcpp #computervision

Пікірлер: 221
@FliBaleon
@FliBaleon 11 ай бұрын
For those who have trouble creating the CMake file, if the extension does not prompt you with the "create new cmkae file", just do this Ctrl+Shift+P Cmake:Qick Start
@MrSoandSoPlaysMC
@MrSoandSoPlaysMC 10 ай бұрын
You are a godsend ... I was wracking my brains for the last 10 minutes. "Like I'm sure I followed the video properly" 😅
@mahmoodalikhan2456
@mahmoodalikhan2456 3 ай бұрын
It worked thank you so much
@marwa1698
@marwa1698 3 ай бұрын
Thank you
@deSloleye
@deSloleye 2 ай бұрын
Thank you!
@kin_1997
@kin_1997 Ай бұрын
wow thank you very much!
@aviraj6554
@aviraj6554 2 жыл бұрын
Hey! Thanks for the help. I have a question though, I just tried to add another cpp file in my folder. It's working so far but I get an error in the include command and I can't just add that file name to my CMake.txt as well. What do I do?
@AvHoCaDo
@AvHoCaDo 11 ай бұрын
Thanks so much for helping me get past the setup xD It's honestly insane to me how convoluted it is just to startup a project, but I guess im just a noob lol Im a somewhat experienced dev, but I usually only work on projects that my coworkers started decades ago. Rarely get to work on my own projects from the ground up.
@NicolaiAI
@NicolaiAI Жыл бұрын
Join My AI Career Program 👉 www.nicolai-nielsen.com/aicareer Enroll in My School and Technical Courses 👉 www.nicos-school.com
@LuizAntonio_Gameplay
@LuizAntonio_Gameplay Жыл бұрын
Thanks for the video. This error appears to me, how do I solve it Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set [cmake] "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" [cmake] provides a separate development package or SDK, be sure it has been [cmake] installed.
@ComputerScienceSimplified
@ComputerScienceSimplified 3 жыл бұрын
Awesome video, keep up the incredible work! :)
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Thank you very much! It really helps me to keep going :)
@luthfiaminulloh8177
@luthfiaminulloh8177 2 жыл бұрын
why do I get an error while using GCC compiler while following this tutorial, should I install and use Visual Studio Community compiler?
@mihirsavla3233
@mihirsavla3233 2 жыл бұрын
CMake was unable to find a build program corresponding to "MinGW Makefiles".
@saltygamer8435
@saltygamer8435 Жыл бұрын
CMakeLists.txt:2 (project):No CMAKE_C_COMPILER could be found . I am getting this error message how do i fix this?
@Phantom-el6oe
@Phantom-el6oe 11 ай бұрын
Cmake file doesn't work anymore: CMake Error at CMakeLists.txt:7 (find_package):By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenCV", but CMake did not find one. Could not find a package configuration file provided by "OpenCV" with any of the following names: OpenCVConfig.cmake opencv-config.cmake Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" provides a separate development package or SDK, be sure it has been installed.
@ryangippner4681
@ryangippner4681 2 жыл бұрын
I am not sure why, but I am unable to find the extensions that you use. I have searched for them; however, none of them show up for me. Does anyone know what I might have done wrong?
@barbearian3054
@barbearian3054 Жыл бұрын
When I do Cmake:Configure, it doesnt show any kits. If I try to scan, none show up. How do I get the vscode to show up?
@Anime-be4ru
@Anime-be4ru 2 жыл бұрын
I got an error on this line Could not find a package configuration file provided by "OpenCV" with any of the following names: OpenCVConfig.cmake opencv-config.cmake Where and how can I fix it? Thanks!
@szhavel
@szhavel Жыл бұрын
It helps me (write before find_packages command) set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /opencv/build/x64/vc15/lib/)
@scottiemurrell5139
@scottiemurrell5139 Жыл бұрын
I followed everything exactly but I have errors on the file that adds the #include #include errors detected based on information provided by the configuration Provider setting. Squiggles are disabled for this translation unit
@surajpatel2717
@surajpatel2717 Жыл бұрын
were you able to solve it? did you get the error after the build? or even before you built it?
@ShopperPlug
@ShopperPlug Жыл бұрын
When after compiling and then running the sample code I get the following error: "Abort trap (core dumped)"
@g2h5j3
@g2h5j3 Жыл бұрын
Hi, getting a bunch of "undefined reference" Errors when i try to build the project (for every CV call). But it doesn't show any errors in code and ctrl-space shows all possible functions... Update: After restarting it doesn't find the functions anymore and i get an error on #include
@D4wGr1
@D4wGr1 10 ай бұрын
Same 🫤
@learntocode5464
@learntocode5464 2 жыл бұрын
Can I use any compiler other than msv_...
@amazlin8271
@amazlin8271 Жыл бұрын
What is the role of installing CMAKE software? Could i work with vscode and opencv without installing cMake?
@inipraiseadeniyi6848
@inipraiseadeniyi6848 2 жыл бұрын
same process for mac? or can you please do one for mac... been struggling with the installation and set up for a while.
@nournour-mc4xh
@nournour-mc4xh 3 жыл бұрын
What about lnk2019 errors occured what is the solution please
@andrewflint6089
@andrewflint6089 2 жыл бұрын
Hey, I'm experiencing an issue where at 7:04, I only see the first two options. I have read a few other comments with people having the same issue but I still cannot rectify my problem. I have all extensions you've mentioned in the video installed, I have uninstalled Visual Studio Code and reinstalled but nothing has changed. Any advice on what I'm doing wrong?
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Do u have visual studio 2019 with c++ development tool installed?
@andrewflint6089
@andrewflint6089 2 жыл бұрын
@@NicolaiAI Thanks so much, I thought I had 2019 installed but I had the 2022 version and it wasn't working but fixed now. Really appreciate the quick reply! Will definitely be using your vids in the future.
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thanks for watching! Glad that i can help
@hiteshvaidya3331
@hiteshvaidya3331 2 жыл бұрын
you need to zoom in to the screen because the file names on your file explorer appear too small in size
@edwinecg5060
@edwinecg5060 3 ай бұрын
Hi, do you know how remove background to person image with opencv
@brandonsamuelcruzsilva7626
@brandonsamuelcruzsilva7626 5 ай бұрын
About the compiler, a useful command is ctrl + shift + p > then cmake: select kit. For some reason gcc compiler didn't work out, but the one used in this video is working ok.
@samueldipo6790
@samueldipo6790 Жыл бұрын
Thanks for the information. I get an error saying "No such file or directory" for running the .exe file even though i can see the .exe file in the buld>Debug folder is there a fix for this?
@aditichakravarthy6491
@aditichakravarthy6491 11 ай бұрын
could you solve it?
@teoextreme
@teoextreme Жыл бұрын
7:23 - Your webcam is blocking the part of the screen, I can't see what you clicked on there. Help please?
@adsz8266
@adsz8266 8 ай бұрын
When I try to configurate cmake, there is no option that include visual studio community release; just gcc ones. Am I have to download visual studio too or there's another way to configurate cmake?
@NicolaiAI
@NicolaiAI 8 ай бұрын
You will have to install visual studio to build on windows
@awabsial7560
@awabsial7560 7 ай бұрын
Can anyone guide ma about "opencv2\face.hpp" i want to include it but i am getting an error "cannot open source file opencv2\face.hpp". No solution found anywhere online. I am using Visual Studio C++ 2022
@sushilkrsoni2796
@sushilkrsoni2796 Жыл бұрын
At 7:00 it is saying No CMakeLists.txt was found What to do ? Please help anyone!!
@snim9515
@snim9515 2 жыл бұрын
at 7:17 I got an error main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found. Also there is no create button. The button in the video is hidden by your picture.
@eskanderassaf2844
@eskanderassaf2844 Жыл бұрын
Please..if you fixed it tell me the way....I got just the same error
@user-eq2ji2tn4x
@user-eq2ji2tn4x 2 жыл бұрын
Hi, I can complie the .cpp file like the video indicates([build] Build finished with exit code 0), but when I run I got following error on the terminal: [ WARN:0@0.015] global C:\build\master_winpack-build-win64-vc15\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('Resources/test.png'): can't open/read file: check file path/integrity No image data (I'm sure the image payh is correct.) can anybody help, please??
@dharanimohan2849
@dharanimohan2849 Жыл бұрын
The same problem for me, anybody helping me to solve this problem would be great
@SharadaNaik-qw2ht
@SharadaNaik-qw2ht Жыл бұрын
Hello, I am doing the steps according to the video. But facing issues while configure_cmake. Receiving error as : Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Could you please tell what has to be done
@jochenderycke9211
@jochenderycke9211 10 ай бұрын
I have the same issue, did you find a solution?
@aiwizardry16
@aiwizardry16 2 жыл бұрын
I got this Error please help !! CMake Error at CMakeLists.txt:7 (find_package): [cmake] Found package configuration file: [cmake] [cmake] C:/DEV/opencv/build/OpenCVConfig.cmake [cmake] [cmake] but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be [cmake] NOT FOUND.
@samjordan5006
@samjordan5006 2 жыл бұрын
fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' - any idea what's going on here?
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Yes u have most likely chosen the wrong architecture for the project/cmake configuration. It depends on what architecture u have installed opencv for but u are most likely looking for x86. Try check in the blue bar at the bottom of vscode
@MrPusmucans
@MrPusmucans Жыл бұрын
Hi. What button or key combination did you press on 7:35? Most interesting when from 60000 people jut me can't go further just because don't know how to create executable project...
@yuconglyu6230
@yuconglyu6230 Жыл бұрын
Ctrl+Shift+P, CMake:Quick start,Then can create executable project.
@shadyzahran3330
@shadyzahran3330 Жыл бұрын
thanks for the video but i keep getting error main.cpp:2:31: fatal error: opencv2/highgui.hpp: No such file or directory #include ^ compilation terminated. although added the opencv to path
@phuho6583
@phuho6583 5 ай бұрын
did u solve it?
@andrew48dhs
@andrew48dhs Жыл бұрын
Would you consider remaking this video for the most recent versions of windows, opencv, and vscode?
@NicolaiAI
@NicolaiAI Жыл бұрын
Yeah I should def do that Andrew! Thanks for the tip
@user-lo4cf5lo1v
@user-lo4cf5lo1v 7 ай бұрын
Can you do a video about installing the opencv-contrib modules when you already have the opencv core installed
@midomarusama
@midomarusama 2 жыл бұрын
Hi thanks so much for this video. I keep getting this error :-( "Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable." This happens when I select Cmake:configure, and select my minGW compiler Would really appreciate any fix for this.
@dionfrancois5649
@dionfrancois5649 2 жыл бұрын
I believe this is a bug, on vscode, select an older version of Cmake Tools and that should work (I had the same problem and that's how I fixed it)
@cameronkerr6258
@cameronkerr6258 Жыл бұрын
@@dionfrancois5649 I have the same bug, do you know how to select an older version of cmake tools?
@sebastianlarsen6713
@sebastianlarsen6713 Жыл бұрын
@@cameronkerr6258 you can also swap to the visual studio community compiler instead of minGW if on windows
@Javier_Chang
@Javier_Chang Жыл бұрын
The latest VS code has bug which not allowed to connect to opencv library while debugging , even setup all environment and path, so i had gave up using VS code for coding.
@tuanphongha8952
@tuanphongha8952 4 ай бұрын
is this true ? Have been trying to install it for a couple of days now and all i got is "no such file or directory"
@andrewjawney1
@andrewjawney1 2 ай бұрын
Finally! a tutorial that actually worked for me... Thank you Soooooo much for this!
@NicolaiAI
@NicolaiAI 2 ай бұрын
Thanks man! Glad it helped
@MrPapirruki
@MrPapirruki 2 жыл бұрын
Hi, great tutorial it help me a lot to get started. I have a question, when you do CMake: Configure -> create a new file...etc. 7:58 CMake generate CMakelist.txt, main.cpp and some other files files. Is there a way to customize those files? I will like to have those, custom made for me
@andraspoljak
@andraspoljak Жыл бұрын
Same here... No popup, what to do next then?
@songoku-lo7il
@songoku-lo7il 3 жыл бұрын
When i run the program i get the error: opencv2/opencv.hpp: no such directory. I have installed everything as per your instructions and also set the path in environment variables. Plz help
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Check the PATH variable u have to add from the description, if that is correct as u say, then i can only see that it's OpenCV that is not installed correctly
@songoku-lo7il
@songoku-lo7il 3 жыл бұрын
@@NicolaiAI i checked it. I have put the opencv folder in my c drive. I still can't find what's wrong. My path variables are also correct
@oguzhanbaser1389
@oguzhanbaser1389 2 жыл бұрын
​@@songoku-lo7il you may forget building the project as well. I.o.w. if you run without building you get this error as well.
@veljkojovanovic2152
@veljkojovanovic2152 2 жыл бұрын
Hey man, maybe it's a long shot since you have done this a year ago, but did you resolve this and do you maybe remember how?
@danecchio6621
@danecchio6621 2 жыл бұрын
Late comment, but thank you! This video is still helping people like me! How in the name could I have found things like this out without needing to depend on the chance that a kind soul like you has made a video on it? Genuinely asking
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thanks a lot for watching and glad that it could help u! It will take a long time to figure out for urself and a bit of knowledge about cmake, how editors work and so on.
@joehenri1
@joehenri1 2 жыл бұрын
At 7:04 I only have the two first options in the CMake configuration. Do you have an idea how to solve my problem ?
@joehenri1
@joehenri1 2 жыл бұрын
update : You simply need to download Visual Studio C++ as he mentionned..
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Great that u figured it out!
@hoangvuviet5923
@hoangvuviet5923 2 жыл бұрын
@@joehenri1 sorry .I downloaded but i still just have two options.After installing it , you do something after ?
@jenowin7269
@jenowin7269 2 жыл бұрын
Can we Do this using MinGW g++ and mingw32-make file?
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Im not sure how to do that, but it might be possible
@datisreyhani4641
@datisreyhani4641 3 жыл бұрын
Hey, thanks for the video! Just wanted to ask how to fix an error in the 'find_package(OpenCV REQUIRED)' command causing it to be flagged up. Thanks!
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Make sure u have everything in release mode and have the path variable as i have in the description
@datisreyhani4641
@datisreyhani4641 3 жыл бұрын
@@NicolaiAI I have the environment variables exactly as you did in the video, but what do you mean by release mode? Thx
@NicolaiAI
@NicolaiAI 3 жыл бұрын
@@datisreyhani4641 u can either compile and run it in debug or release mode. In the video i configure it in cmake with release mode and do it in vscode aswell
@datisreyhani4641
@datisreyhani4641 3 жыл бұрын
@@NicolaiAI Thanks! It turns out it didn't work because of something I'd accidentally done, so when I deleted it and re-followed your tutorial it worked perfectly! I cannot thank you enough!
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Great that u figured it out! Enjoy
@soulaygaming9937
@soulaygaming9937 11 ай бұрын
Good Video! It Helped! 👍
@NicolaiAI
@NicolaiAI 11 ай бұрын
Awesome man! Glad I could help
@HungBui-gu2wk
@HungBui-gu2wk 2 жыл бұрын
Thenkiu so much. From Vietnam with love
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thank you! Glad that u like it
@vaishnaviseshadri7128
@vaishnaviseshadri7128 2 жыл бұрын
Hey thanks a lot. but can u please make a video on how to add the tracking modules? Wld be really helpful
@giada6242
@giada6242 2 жыл бұрын
Excelent video! But, I'm sorry, I have an error. On a minute 10:18 when you write "target_link_libraries( opencv-setup ${OpenCV_LIBS} )", I've an error: "CMake Error at CMakeLists.txt:12 (target_link_libraries):Cannot specify link libraries for target "opencv-setup" which is not built by this project" Why? And what I have to do to resolve it? Thank you very much!
@minteligencia
@minteligencia 2 жыл бұрын
kzbin.info/www/bejne/bJWXm35mo99sZ5o
@dralliteration
@dralliteration 2 жыл бұрын
Thank you very much for your help ^^
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thanks for watching! Really glad that i could help u
@alex15558
@alex15558 2 жыл бұрын
jooo hsnr lässt grüßen
@emreozbek6770
@emreozbek6770 7 ай бұрын
It wants me to load a cmake.txt file
@TarunKrishnanextra
@TarunKrishnanextra 2 жыл бұрын
Awesome! thanks a lot
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thanks for watching! Glad that it could help u
@kin_1997
@kin_1997 Ай бұрын
holy hell the setup is brutal
@walleve_
@walleve_ Жыл бұрын
Great video. Although it must be mentioned that one need to install visual studio (for c++ compiler) before as well as visual studio code (vs code). I had mingw installed as compiler for using c++ in vs code and this was not compatible with opencv and was giving "mutex error".
@JoceAC
@JoceAC Жыл бұрын
so were you able to make it work with mingiw as a compiler or did you had to change to visual studio for compiling?
@sarveshprajapati3878
@sarveshprajapati3878 Жыл бұрын
Yes lol, was trying to build pthread and what not from source, easiest thing to do is just download c++ from vs code.
@spaceflight2608
@spaceflight2608 Жыл бұрын
Thank you so much!
@NicolaiAI
@NicolaiAI Жыл бұрын
You're welcome!
@immischa4566
@immischa4566 2 жыл бұрын
Hello, I did everything like in the Video, but I get the error: opencv2/opencv.hpp: no such file or directory gcc And I dont know what to do, please help
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Do u have opencv in ur environmental variables?
@immischa4566
@immischa4566 2 жыл бұрын
@@NicolaiAI I addet the 3 that are shown in the Video
@NicolaiAI
@NicolaiAI 2 жыл бұрын
@@immischa4566 then it can only be the cmake configuration
@immischa4566
@immischa4566 2 жыл бұрын
@@NicolaiAI In the Cmake conf at 7:04 I only had the first 3 to choose from, so I selected MIngw bc I usually used it for my projects I did instaall all the extensions as you showed
@NicolaiAI
@NicolaiAI 2 жыл бұрын
I have not tried it with a different compiler but my guess would be that it's supposed to work with mingw
@MirakXfire
@MirakXfire 3 жыл бұрын
nice video honestly compared to visual studio integration it s simpler using cmake
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Thank you! Yes its way simpler to set up in vscode and for smaller projects. I'll still prefer visual studio for larger projects
@minhtrio1785
@minhtrio1785 2 жыл бұрын
Nothing happened when I press the CMake: Configure button. I dont see any architecture options or anything. It just disappear
@yaroslavprotsenko4116
@yaroslavprotsenko4116 2 жыл бұрын
Same
@minhtrio1785
@minhtrio1785 2 жыл бұрын
@@yaroslavprotsenko4116 I figured it out, already. You have to open your folder in VSCode first
@antonkisel4732
@antonkisel4732 Ай бұрын
Great video, thank you very much!!!
@NicolaiAI
@NicolaiAI Ай бұрын
Thanks a lot! Glad you liked it
@Stefan-qs2tq
@Stefan-qs2tq Жыл бұрын
Hello! Tank you very much for this video! i tried to install all components. but i have some failures: Error LNK 2019, LNK 4272 - 7:00 i use the release - X86, fatal error LNK 1120. can you help me? its my first project in Virtual Studio. it would be very helpful if you can explain how i can fix these failures. with best regards stefan
@prttyflvck0
@prttyflvck0 Жыл бұрын
have u managed to fix this?
@kabadar
@kabadar Жыл бұрын
thanks! i'm looking for codeblocks opencv installation
@AiPhile
@AiPhile 3 жыл бұрын
Here we need visual studio build tools as well, how you have compiled without them?
@NicolaiAI
@NicolaiAI 3 жыл бұрын
What build tools are u thinking about? Have u installed CMake Tools?
@AiPhile
@AiPhile 3 жыл бұрын
@@NicolaiAI I have already setup this, requirements were different, you have mentioned here, Visual studio(not visual studio code) and c++ development are required.
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Yes this video is about visual studio code as the title says
@AiPhile
@AiPhile 3 жыл бұрын
@@NicolaiAI yeah i know but i want to confirm?
@luisaraya2676
@luisaraya2676 3 жыл бұрын
@@AiPhile bro, was the same for me. I needed to installed Visual Studio Community first. Checkout when you elected the compiler, its says "Visual Studio Community". And when you install VSComunnity, select the option for C/C++ developers and then just follow the video. The video is just amazing, excellent content! Keep it up!
@hytryi_huy
@hytryi_huy 8 ай бұрын
works! thanks
@NicolaiAI
@NicolaiAI 8 ай бұрын
Awesome man! Happy that you got it to work
@BlacksoulRider
@BlacksoulRider 2 жыл бұрын
Hey, Thanks for the video. I did exactly what you showed in the video but I get an error with opencv header files not found: main.cpp:2:10: fatal error: opencv2/opencv.hpp: No such file or directory 2 | #include | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thanks for watching! Did u set the environmental variables?
@BlacksoulRider
@BlacksoulRider 2 жыл бұрын
@@NicolaiAI yes, i have set the environment variables.
@veljkojovanovic2152
@veljkojovanovic2152 2 жыл бұрын
@@BlacksoulRider Hey, I know it's far fetched cause you have done it ages ago, but did you figure out why this happened? I have the same problem. I would be most grateful.
@BlacksoulRider
@BlacksoulRider 2 жыл бұрын
@@veljkojovanovic2152 Unfortunately, NO, it didn't work in VS code for some reason. However, I built opencv from source using Cmake and continued using Visual Studio Community.
@michaelch3722
@michaelch3722 2 жыл бұрын
Hello, thanks for the great videos! I have had issues for 2 days, I can't make it. So I followed steps like u said, create PATH for env, then configure CMAKE, but [cmake] CMake Error at CMakeLists.txt:2 (project): [cmake] Generator [cmake] [cmake] Visual Studio 17 2022 [cmake] [cmake] could not find any instance of Visual Studio. I found this error, and Idk what to do. Thank you!
@user-vp3do9yt5y
@user-vp3do9yt5y 10 ай бұрын
I tried your method with my laptop, it failed. I bought a new laptop last week and tried your method again today, it still failed.
@Nuvenss
@Nuvenss 2 жыл бұрын
Thank you so much
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thanks a lot for watching!
@pademo57
@pademo57 6 ай бұрын
Unfortunately none of this worked for me. Tried cmake:Quick Start, still getting "unable to determine what CMake generator to use. VS still can't find a compiler. Using latest version of VS. OpenCV and CMake. Totally disappointed especially because all of his other videos have been great.
@ericbighead8953
@ericbighead8953 3 жыл бұрын
Great video! Do you know or can explain how to use OpenCV with C# in Visual Studio?
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Thank you! I havent tried it with C# before, but i'll look into it and see if i can figure something out :)
@ericbighead8953
@ericbighead8953 3 жыл бұрын
@@NicolaiAI That would be great! I found out that I have to use EMGU CV C# Wrapper. But until now I haven’t tried it out
@aguycalledSilas
@aguycalledSilas 2 жыл бұрын
Well. Now it says build finished with Error 2. I got to say yours was the most useful thing i found so far about how to set this up for vs code. Im on linux though so things are different i guess. I have followed like 10 different tutorials so far and it all falls apart at some point. maybe i should stop trying to learn coding if i cant even work with libraries.
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Hi Yeah Linux is a bit different since u need visual studio 2019 c++ development tool to be able to do it this way. It's not available on Linux. Definitely don't give up on coding because of libraries. It's not the easiest if u are just starting out. My recommendation would be to start more simple and make tale a look at python first and get familiar with everything and then read up on libraries and cmake
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Yeah u should definitely look into how to link to the binaries of the libraries. Often cmake is used to set up and link libraries, at least if u just want to set up some projects fast. So take a look at some cmake tutorials and so on and maybe start out with windows unless u need Linux for some specific things. I prefer Linux too but lost things out on the internet are in windows of what I have seen. Can be done in Linux easily but u need some knowledge about how it works and how to do it of course
@Taha-yd4gp
@Taha-yd4gp Жыл бұрын
legend
@deSloleye
@deSloleye 2 ай бұрын
I hope since then he's learned to put his camera stream somewhere other than over the place he needs to work.
@hammerhaj1
@hammerhaj1 3 жыл бұрын
How to install opencv_contrib VS code?
@hammerhaj1
@hammerhaj1 3 жыл бұрын
Done it! Cmake
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Great that u figured it out!
@genayadelaide3157
@genayadelaide3157 Жыл бұрын
Installed OpenCV on D:/. At first, it seems CMake couldn't find it, but after running "CMake: Delete cache and Reconfigure" it worked. Great tutorial, but please reduce your word flow in the future, it's quite hard to listen to.
@elkinguerra8287
@elkinguerra8287 3 жыл бұрын
I got a problem, in the command 'find_package( OpenCV REQUIRED )' .
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Then OpenCV is not install correctly
@elkinguerra8287
@elkinguerra8287 3 жыл бұрын
Yes, I just fixed it, thanks a lot for these videos
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Thanks for watching! Glad that u figured it out
@datisreyhani4641
@datisreyhani4641 3 жыл бұрын
@@elkinguerra8287 Hi, how did you fix this? I reinstalled it from the executable but it didn't seem to work....
@elkinguerra8287
@elkinguerra8287 3 жыл бұрын
@@datisreyhani4641 hi! My problem was that I hadn't created the environmental variable for OpenCV, when I created it then everything worked fine, the variable that I created was OpenCV_DIR that is the path to the lib directory
@aliksargsyan2782
@aliksargsyan2782 Жыл бұрын
Your content is so wonderful. But don't you use CLion IDE instead?
@NicolaiAI
@NicolaiAI Жыл бұрын
Thanks a lot bro! I just prefer vs code over anything because of the look and all the extensions
@matheusribeiro2739
@matheusribeiro2739 2 жыл бұрын
thanks man. that's worked fine for me.
@NicolaiAI
@NicolaiAI 2 жыл бұрын
Thanks for watching! Glad that i could help
@devanshudwivedi5875
@devanshudwivedi5875 3 жыл бұрын
I encountered a small problem at 7:04. VS code shows only 3 options: 1.[Scan for kits] Search for compilers on this computer 2.[unspecified] Unspecified (Let Cmake guess what compiler and environment to use) 3. GCC 8.1.0 i686-mngw32 Using compilers: C=C:\...... which one do I select? I am trying perform watermarking on 1080p images using only c.
@devanshudwivedi5875
@devanshudwivedi5875 2 жыл бұрын
@@stalinsaravanan3059 apparently 3rd option works. Try that
@TheKidHD
@TheKidHD 2 жыл бұрын
Hey I had the same problem all day, I resolved the issue by installing Visual Studio 2019 Community. Those three option you have are the compilers you can use however, in the tutorial we see The Coding Lib select the Visual Studio 2019 Community Release. Hopefully that helped be sure to install it, run it and set it up and the other options should populate.
@user-rk9kq4ky7d
@user-rk9kq4ky7d 2 жыл бұрын
bro, nice video. But ur high speed may not be a friendly choice for a EN-specker
@balveersingh3051
@balveersingh3051 9 ай бұрын
Day 1 done
@NicolaiAI
@NicolaiAI 9 ай бұрын
Cool man! Thats commitment
@lalithsasubilli8103
@lalithsasubilli8103 Жыл бұрын
should i trust this?
@stellamn
@stellamn 2 жыл бұрын
Could you do a linux version? That would be great!
@NicolaiAI
@NicolaiAI 2 жыл бұрын
I'll definitely do that
@saranh1687
@saranh1687 2 жыл бұрын
@@NicolaiAI can you do the linux one with contrib module.set it up in linux with contrib with either clion or vscode
@samsonmoturi7731
@samsonmoturi7731 Ай бұрын
Don't know if anyone else encountered the problem when you ctrl+p and click Cmake: configure then it doesn't give you the amdx86(kits)... You could go to the very bottom of vscode and select no active kits::::will take you to the kits .. Had this error for the last day....tip for those who might encounter the same problem
@Divyansh-ll1ps
@Divyansh-ll1ps 24 күн бұрын
What is very button?? I couldn’t find that
@RegishShrestha
@RegishShrestha 3 жыл бұрын
Not working broo
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Do u have visual studio 2019 with c++ development?
@RegishShrestha
@RegishShrestha 3 жыл бұрын
@@NicolaiAI I have visual studio code and c++ development extension or c++ ?? I have c++ but I don't have c++ development
@NicolaiAI
@NicolaiAI 3 жыл бұрын
@@RegishShrestha try install visual studio 2019 and check off c++ development tool and see if that solves ur problems
@RegishShrestha
@RegishShrestha 3 жыл бұрын
@@NicolaiAI thank you .Yeah now it worked
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Great! 🙂
@SweAwesome
@SweAwesome Жыл бұрын
For people getting the linking errors ( LNK2019 LNK4272 LNK1120 ), select a different kit, shift+ctrl & P --> "Select a Kit" and choose something different, maybe amd64 and build again after a few seconds.
@minwoohwang8751
@minwoohwang8751 Жыл бұрын
THANKYOUU
@chrisguy6301
@chrisguy6301 11 ай бұрын
In my case, it was because I was launching it from C/C++ (top right) instead of CMake/Launch from the button at the bottom.
@pjwetherell9414
@pjwetherell9414 Жыл бұрын
Your webcam blocks a lot of useful information. I found it really hard to follow what was going on because of this.
@h0vaK
@h0vaK 3 ай бұрын
Meanwhile in python: _pip3 install opencv-python_
@crackwitz
@crackwitz 5 ай бұрын
the first 15 seconds were unintelligible. please slow down.
@Kaszanas
@Kaszanas 3 жыл бұрын
This tutorial is unusable for any extensive development with OpenCV and CMake. It's nice it works for You but honestly this is in no way documenting a proper way of OpenCV installation and usage. Especially if You are using any kind of version control.
@NicolaiAI
@NicolaiAI 3 жыл бұрын
That's not the purpose of the video. 98% of people watching this video haven't used OpenCV before and for learning purpose.
@NicolaiAI
@NicolaiAI 3 жыл бұрын
And to be clear I'm not building OpenCV from source files but using the installed package. Make sure to check the channel out before leaving random comments if u are going to make comments. Ur comment is for no use since i have several videos building OpenCV from source files with different versions and so on.
@applejuice5785
@applejuice5785 10 ай бұрын
did everything still get fatal error: opencv2/opencv.hpp: No such file or directory #include
@xAllstar249
@xAllstar249 3 ай бұрын
i have the same issue; did you ever resolve it? if so, how? thanks.
@king_bisha4841
@king_bisha4841 Жыл бұрын
If someone is having this error in WINDOWS10: [cmake] Could not find a package configuration file provided by "OpenCV" with any [cmake] of the following names: [cmake] [cmake] OpenCVConfig.cmake [cmake] opencv-config.cmake What to do: add to CMakeLists.txt the following: set(OpenCV_DIR "/opencv/build") before include_directories( ${OpenCV_INCLUDE_DIRS} )
@king_bisha4841
@king_bisha4841 Жыл бұрын
Also restart VS code if code is not running
@NicolaiAI
@NicolaiAI Жыл бұрын
Thanks!
@king_bisha4841
@king_bisha4841 Жыл бұрын
@@NicolaiAI Nothing bro! Thank you for the great videos!
@NicolaiAI
@NicolaiAI Жыл бұрын
Thanks a lot for the support!
@godse54
@godse54 2 жыл бұрын
fatal error: opencv2/opencv.hpp: No such file or directory #include
@omerfarukgunaydn4881
@omerfarukgunaydn4881 Жыл бұрын
did u solve
@Alvaro_Mont
@Alvaro_Mont Жыл бұрын
did you solve?
@alihamdy3550
@alihamdy3550 2 жыл бұрын
Awesome video, keep up the good work, i did all the steps but i get this when I build the project: [build] Starting build [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build "d:/3d reconstruction/opencvtest/build" --config Debug --target all -j 18 -- [build] [ 50%] Building CXX object CMakeFiles/opencvtest.dir/main.cpp.obj [build] [100%] Linking CXX executable opencvtest.exe [build] CMakeFiles\opencvtest.dir/objects.a(main.cpp.obj): In function `main': [build] D:/3d reconstruction/opencvtest/main.cpp:8: undefined reference to `cv::Mat::Mat()' [build] D:/3d reconstruction/opencvtest/main.cpp:9: undefined reference to `cv::imread(std::__cxx11::basic_string const&, int)' [build] D:/3d reconstruction/opencvtest/main.cpp:9: undefined reference to `cv::Mat::operator=(cv::Mat&&)' [build] D:/3d reconstruction/opencvtest/main.cpp:9: undefined reference to `cv::Mat::~Mat()' [build] D:/3d reconstruction/opencvtest/main.cpp:15: undefined reference to `cv::namedWindow(std::__cxx11::basic_string const&, int)' [build] D:/3d reconstruction/opencvtest/main.cpp:16: undefined reference to `cv::imshow(std::__cxx11::basic_string const&, cv::_InputArray const&)' [build] D:/3d reconstruction/opencvtest/main.cpp:17: undefined reference to `cv::waitKey(int)' [build] D:/3d reconstruction/opencvtest/main.cpp:8: undefined reference to `cv::Mat::~Mat()' [build] D:/3d reconstruction/opencvtest/main.cpp:9: undefined reference to `cv::Mat::~Mat()' [build] D:/3d reconstruction/opencvtest/main.cpp:8: undefined reference to `cv::Mat::~Mat()' [build] collect2.exe: error: ld returned 1 exit status [build] mingw32-make.exe[2]: *** [CMakeFiles\opencvtest.dir\build.make:115: opencvtest.exe] Error 1 [build] mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:838: CMakeFiles/opencvtest.dir/all] Error 2 [build] mingw32-make.exe: *** [Makefile:120: all] Error 2 [build] Build finished with exit code 2
@tanmaythaker2905
@tanmaythaker2905 2 жыл бұрын
Same problem. Did u find a solution for it?
@4790kusi
@4790kusi 2 жыл бұрын
Same
@applhau9876
@applhau9876 7 ай бұрын
I know this is crazy late but did you figure out the solution
@burgenkinger2856
@burgenkinger2856 3 жыл бұрын
so every time that I want to create an opencv project, I need to create such Cmakelist? is that any method to avoid that?
@NicolaiAI
@NicolaiAI 3 жыл бұрын
Nope u would have to do that, but it probably takes 20 seconds when u get used to it. You can just copy paste it from github or something
C++ in VS Code: Building your Code with CMake
9:37
Visual Studio Code
Рет қаралды 20 М.
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 30 МЛН
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 20 МЛН
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 10 МЛН
How To Use VS CODE for C++ | With CMake & Any Compiler
9:14
Code, Tech, and Tutorials
Рет қаралды 73 М.
When RESTful architecture isn't enough...
21:02
Dreams of Code
Рет қаралды 253 М.
Comparison between YOLOv10, YOLOv9 and YOLOv8 on Real-world Videos
10:35
BEST WAY to make Desktop Applications in C++
26:00
The Cherno
Рет қаралды 896 М.
CMake, How it Works (At Three Different Levels)
4:36
Kea Sigma Delta
Рет қаралды 10 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 6 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 59 МЛН
Как бесплатно замутить iphone 15 pro max
0:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2,8 МЛН
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 898 М.