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

Поделиться
HTML-код
  • Опубликовано: 18 окт 2024

Комментарии • 227

  • @FliBaleon
    @FliBaleon Год назад +58

    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 Год назад +2

      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 6 месяцев назад +1

      It worked thank you so much

    • @marwa1698
      @marwa1698 6 месяцев назад +1

      Thank you

    • @deSloleye
      @deSloleye 5 месяцев назад

      Thank you!

    • @kin_1997
      @kin_1997 4 месяца назад

      wow thank you very much!

  • @NicolaiAI
    @NicolaiAI  Год назад +1

    Join My AI Career Program
    👉 www.nicolai-nielsen.com/aicareer
    Enroll in My School and Technical Courses
    👉 www.nicos-school.com

  • @kin_1997
    @kin_1997 4 месяца назад +7

    holy hell the setup is brutal

  • @brandonsamuelcruzsilva7626
    @brandonsamuelcruzsilva7626 8 месяцев назад +1

    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.

  • @AvHoCaDo
    @AvHoCaDo Год назад +6

    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.

  • @Anime-be4ru
    @Anime-be4ru 2 года назад +5

    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 Год назад +4

      It helps me (write before find_packages command) set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /opencv/build/x64/vc15/lib/)

  • @ComputerScienceSimplified
    @ComputerScienceSimplified 3 года назад +14

    Awesome video, keep up the incredible work! :)

    • @NicolaiAI
      @NicolaiAI  3 года назад +1

      Thank you very much! It really helps me to keep going :)

  • @andrewjawney1
    @andrewjawney1 4 месяца назад +1

    Finally! a tutorial that actually worked for me... Thank you Soooooo much for this!

    • @NicolaiAI
      @NicolaiAI  4 месяца назад

      Thanks man! Glad it helped

  • @scottiemurrell5139
    @scottiemurrell5139 Год назад +4

    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 Год назад +2

      were you able to solve it? did you get the error after the build? or even before you built it?

  • @danecchio6621
    @danecchio6621 2 года назад +4

    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.

  • @hiteshvaidya3331
    @hiteshvaidya3331 2 года назад +2

    you need to zoom in to the screen because the file names on your file explorer appear too small in size

  • @Phantom-el6oe
    @Phantom-el6oe Год назад +3

    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.

  • @luthfiaminulloh8177
    @luthfiaminulloh8177 2 года назад +2

    why do I get an error while using GCC compiler while following this tutorial, should I install and use Visual Studio Community compiler?

  • @samsonmoturi7731
    @samsonmoturi7731 4 месяца назад +3

    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 3 месяца назад

      What is very button?? I couldn’t find that

  • @songoku-lo7il
    @songoku-lo7il 3 года назад +4

    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 года назад +1

      @@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 года назад +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?

  • @MirakXfire
    @MirakXfire 3 года назад +5

    nice video
    honestly compared to visual studio integration it s simpler using cmake

    • @NicolaiAI
      @NicolaiAI  3 года назад +2

      Thank you! Yes its way simpler to set up in vscode and for smaller projects. I'll still prefer visual studio for larger projects

  • @teoextreme
    @teoextreme Год назад +1

    7:23 - Your webcam is blocking the part of the screen, I can't see what you clicked on there. Help please?

  • @JUANjuan871ju
    @JUANjuan871ju 4 дня назад

    CMake Error at CMakeLists.txt:2 (project):Running
    'nmake' '-?'
    failed with:
    no such file or directory
    can someone help me with this

  • @protozilla
    @protozilla Месяц назад +1

    When I try to configure cmake, the only two options that show up are "Browse for CmakeLists.txt" or "Dont show Again" none of my compilers show up. What should I do?

    • @v0id683
      @v0id683 14 дней назад

      Same here

  • @immischa4566
    @immischa4566 2 года назад +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

  • @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.

  • @andrew48dhs
    @andrew48dhs Год назад +3

    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

  • @aguycalledSilas
    @aguycalledSilas 2 года назад +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

  • @adsz8266
    @adsz8266 11 месяцев назад +1

    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  11 месяцев назад +1

      You will have to install visual studio to build on windows

  • @aviraj6554
    @aviraj6554 2 года назад +3

    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?

  • @HungBui-gu2wk
    @HungBui-gu2wk 3 года назад +2

    Thenkiu so much. From Vietnam with love

    • @NicolaiAI
      @NicolaiAI  3 года назад

      Thank you! Glad that u like it

  • @snim9515
    @snim9515 2 года назад +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

  • @midomarusama
    @midomarusama 2 года назад +3

    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

  • @AiPhile
    @AiPhile 3 года назад +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!

  • @walleve_
    @walleve_ Год назад +6

    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.

  • @saltygamer8435
    @saltygamer8435 Год назад

    CMakeLists.txt:2 (project):No CMAKE_C_COMPILER could be found . I am getting this error message how do i fix this?

  • @g2h5j3
    @g2h5j3 2 года назад +2

    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 Год назад

      Same 🫤

  • @LuizAntonio_Gameplay
    @LuizAntonio_Gameplay 2 года назад +1

    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.

  • @mihirsavla3233
    @mihirsavla3233 3 года назад +2

    CMake was unable to find a build program corresponding to "MinGW Makefiles".

  • @SharadaNaik-qw2ht
    @SharadaNaik-qw2ht Год назад +1

    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

  • @samueldipo6790
    @samueldipo6790 Год назад +1

    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?

  • @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?

  • @ALUNGAJoshuaJerry
    @ALUNGAJoshuaJerry 10 месяцев назад

    Can you do a video about installing the opencv-contrib modules when you already have the opencv core installed

  • @datisreyhani4641
    @datisreyhani4641 3 года назад +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 года назад +1

      Make sure u have everything in release mode and have the path variable as i have in the description

    • @datisreyhani4641
      @datisreyhani4641 3 года назад +2

      @@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 года назад +1

      @@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 года назад +2

      @@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 года назад +1

      Great that u figured it out! Enjoy

  • @soulaygaming9937
    @soulaygaming9937 Год назад +1

    Good Video! It Helped! 👍

    • @NicolaiAI
      @NicolaiAI  Год назад

      Awesome man! Glad I could help

  • @amazlin8271
    @amazlin8271 Год назад

    What is the role of installing CMAKE software?
    Could i work with vscode and opencv without installing cMake?

  • @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.

  • @awabsial7560
    @awabsial7560 10 месяцев назад

    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

  • @balveersingh3051
    @balveersingh3051 11 месяцев назад +2

    Day 1 done

    • @NicolaiAI
      @NicolaiAI  11 месяцев назад +1

      Cool man! Thats commitment

  • @nournour-mc4xh
    @nournour-mc4xh 3 года назад +2

    What about lnk2019 errors occured what is the solution please

  • @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?

  • @deSloleye
    @deSloleye 5 месяцев назад

    I hope since then he's learned to put his camera stream somewhere other than over the place he needs to work.

  • @giada6242
    @giada6242 2 года назад +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 года назад

      ruclips.net/video/6d4jK0nz918/видео.html

  • @antonkisel4732
    @antonkisel4732 4 месяца назад +1

    Great video, thank you very much!!!

    • @NicolaiAI
      @NicolaiAI  4 месяца назад

      Thanks a lot! Glad you liked it

  • @hytryi_huy
    @hytryi_huy 11 месяцев назад +1

    works! thanks

    • @NicolaiAI
      @NicolaiAI  11 месяцев назад

      Awesome man! Happy that you got it to work

  • @joehenri1
    @joehenri1 3 года назад +1

    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 3 года назад +2

      update : You simply need to download Visual Studio C++ as he mentionned..

    • @NicolaiAI
      @NicolaiAI  3 года назад

      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 ?

  • @edwinecg5060
    @edwinecg5060 6 месяцев назад

    Hi, do you know how remove background to person image with opencv

  • @andrewflint6089
    @andrewflint6089 2 года назад +3

    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 года назад +1

      Do u have visual studio 2019 with c++ development tool installed?

    • @andrewflint6089
      @andrewflint6089 2 года назад +1

      @@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

  • @spaceflight2608
    @spaceflight2608 Год назад +1

    Thank you so much!

  • @pademo57
    @pademo57 8 месяцев назад

    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.

  • @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 8 месяцев назад

      did u solve it?

  • @samjordan5006
    @samjordan5006 3 года назад +1

    fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' - any idea what's going on here?

    • @NicolaiAI
      @NicolaiAI  3 года назад +1

      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

  • @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 7 месяцев назад

      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"

  • @dralliteration
    @dralliteration 3 года назад +2

    Thank you very much for your help ^^

    • @NicolaiAI
      @NicolaiAI  3 года назад

      Thanks for watching! Really glad that i could help u

    • @alex15558
      @alex15558 3 года назад +1

      jooo hsnr lässt grüßen

  • @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.

  • @Taha-yd4gp
    @Taha-yd4gp Год назад +1

    legend

  • @TarunKrishnanextra
    @TarunKrishnanextra 2 года назад +1

    Awesome! thanks a lot

    • @NicolaiAI
      @NicolaiAI  2 года назад

      Thanks for watching! Glad that it could help u

  • @我弱
    @我弱 Год назад

    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.

  • @burgenkinger2856
    @burgenkinger2856 3 года назад +1

    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

  • @ericbighead8953
    @ericbighead8953 3 года назад +3

    Great video! Do you know or can explain how to use OpenCV with C# in Visual Studio?

    • @NicolaiAI
      @NicolaiAI  3 года назад +1

      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 года назад +1

      @@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

  • @ShopperPlug
    @ShopperPlug 2 года назад

    When after compiling and then running the sample code I get the following error: "Abort trap (core dumped)"

  • @pipinstallpycaret4056
    @pipinstallpycaret4056 25 дней назад

    No such file or directory detected after build everything

  • @murataavcu
    @murataavcu 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.

  • @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

  • @sushilkrsoni2796
    @sushilkrsoni2796 Год назад

    At 7:00 it is saying
    No CMakeLists.txt was found
    What to do ?
    Please help anyone!!

  • @aliksargsyan2782
    @aliksargsyan2782 Год назад +1

    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

  • @M1122-s3g
    @M1122-s3g 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

  • @jenowin7269
    @jenowin7269 2 года назад +1

    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

  • @BlacksoulRider
    @BlacksoulRider 2 года назад +1

    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.

  • @kabadar
    @kabadar Год назад

    thanks! i'm looking for codeblocks opencv installation

  • @Nuvenss
    @Nuvenss 2 года назад +1

    Thank you so much

    • @NicolaiAI
      @NicolaiAI  2 года назад +1

      Thanks a lot for watching!

  • @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 года назад +1

      Same

    • @minhtrio1785
      @minhtrio1785 2 года назад

      @@yaroslavprotsenko4116 I figured it out, already. You have to open your folder in VSCode first

  • @alihamdy3550
    @alihamdy3550 2 года назад +6

    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 года назад +1

      Same problem. Did u find a solution for it?

    • @4790kusi
      @4790kusi 2 года назад

      Same

    • @applhau9876
      @applhau9876 9 месяцев назад

      I know this is crazy late but did you figure out the solution

  • @邹凯-g3j
    @邹凯-g3j 2 года назад

    bro, nice video. But ur high speed may not be a friendly choice for a EN-specker

  • @learntocode5464
    @learntocode5464 3 года назад

    Can I use any compiler other than msv_...

  • @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!

  • @matheusribeiro2739
    @matheusribeiro2739 2 года назад +1

    thanks man. that's worked fine for me.

    • @NicolaiAI
      @NicolaiAI  2 года назад

      Thanks for watching! Glad that i could help

  • @MrPapirruki
    @MrPapirruki 2 года назад +1

    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?

  • @SweAwesome
    @SweAwesome Год назад +2

    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 Год назад +1

      THANKYOUU

    • @chrisguy6301
      @chrisguy6301 Год назад +1

      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.

  • @emreozbek6770
    @emreozbek6770 10 месяцев назад

    It wants me to load a cmake.txt file

  • @lalithsasubilli8103
    @lalithsasubilli8103 2 года назад

    should i trust this?

  • @devanshudwivedi5875
    @devanshudwivedi5875 3 года назад +2

    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 3 года назад

      @@stalinsaravanan3059 apparently 3rd option works. Try that

    • @TheKidHD
      @TheKidHD 3 года назад

      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.

  • @pjwetherell9414
    @pjwetherell9414 2 года назад

    Your webcam blocks a lot of useful information. I found it really hard to follow what was going on because of this.

  • @h0vaK
    @h0vaK 6 месяцев назад

    Meanwhile in python: _pip3 install opencv-python_

  • @hammerhaj1
    @hammerhaj1 3 года назад +1

    How to install opencv_contrib VS code?

    • @hammerhaj1
      @hammerhaj1 3 года назад

      Done it! Cmake

    • @NicolaiAI
      @NicolaiAI  3 года назад

      Great that u figured it out!

  • @Stefan-qs2tq
    @Stefan-qs2tq 2 года назад

    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

  • @applejuice5785
    @applejuice5785 Год назад +1

    did everything still get fatal error: opencv2/opencv.hpp: No such file or directory
    #include

    • @xAllstar249
      @xAllstar249 6 месяцев назад +1

      i have the same issue; did you ever resolve it? if so, how? thanks.

  • @stellamn
    @stellamn 3 года назад +1

    Could you do a linux version? That would be great!

    • @NicolaiAI
      @NicolaiAI  3 года назад +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

  • @crackwitz
    @crackwitz 8 месяцев назад

    the first 15 seconds were unintelligible. please slow down.

  • @RegishShrestha
    @RegishShrestha 3 года назад +2

    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 года назад +1

      @@NicolaiAI thank you .Yeah now it worked

    • @NicolaiAI
      @NicolaiAI  3 года назад

      Great! 🙂

  • @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.

  • @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 Год назад +1

      Also restart VS code if code is not running

    • @NicolaiAI
      @NicolaiAI  Год назад

      Thanks!

    • @king_bisha4841
      @king_bisha4841 Год назад +1

      @@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

  • @elkinguerra8287
    @elkinguerra8287 3 года назад +1

    I got a problem, in the command 'find_package( OpenCV REQUIRED )' .

    • @NicolaiAI
      @NicolaiAI  3 года назад

      Then OpenCV is not install correctly

    • @elkinguerra8287
      @elkinguerra8287 3 года назад +1

      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