How to Setup OpenCV for C++ on Visual Studio Code (MacOS)

  Рет қаралды 11,530

Elliotcodes

Elliotcodes

Күн бұрын

Tutorial files: github.com/Inf...
Install homebrew in terminal: /bin/bash -c "$(curl -fsSL raw.githubuser...)"
Install OpenCV via homebrew: brew install opencv
touch CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(MyProject)
find_package(OpenCV REQUIRED)
add_executable(MyProject main.cpp)
target_link_libraries(MyProject ${OpenCV_LIBS})
mkdir build
cd build
cmake ..
make
./MyProject
Do the "make" command AFTER you have pasted the code into the script and have saved it.
Join my discord server!: / discord
I use Nvidia Shadowplay and OBS studio to record
Record with 60fps + 4k res + 50 bitrate
I edit with Sony Vegas Pro 16
Any video that are recorded without my pc webcam are using the camera on my Oneplus 7 Pro(The phone I use)
Socials
Twitch: / qtinfectious
KZbin: / @elliotarledge
Instagram: qtinfectious
Twitter: @qtInfectious
Equipment:
Mouse: Razer Viper Mini - Wired
Keyboard: Apex Pro TKL (omnipoint switches)
Headset: HyperX Cloud ll
Webcam/Mousecam: Logitech Brio
Mousepad: Aqua Control Plus
Primary Monitor: Acer v279-144hz-1ms
Secondary Monitor: 144hz dell 24 inch monitor
Router: ROG Rapture GT-AC5300
PC Specs:
Graphics Card: Nvidia Geforce 3070 (FHR)
Processor: Ryzen 5 3600x
Motherboard: Msi Tomahawk b450
Memory: 32GB-3200mhz
Storage: 500GB nvme SSD & 1 TB Western Digital SSD
Power Supply: 650 watts +80 Gold

Пікірлер: 40
@itheblackwolfofmyfamily
@itheblackwolfofmyfamily 9 ай бұрын
Concise and easy to understand. I salute you, big bro. Keep up the good work.
@TheOtherNEO
@TheOtherNEO Жыл бұрын
Great video. Been trying since the morning to find instructions that actually worked. This is the only one that worked as promised. Used to work with C++ and OpenCV on Linux and Windows. Only recently started on MacOS so it is taking time to get the same things working.
@tapahni
@tapahni 3 ай бұрын
Holy shit there is a video on this. Thanks so much
@rukshanj.senanayaka1467
@rukshanj.senanayaka1467 Жыл бұрын
Works with Mac M1 Perfect! have been searching for this a lot!
@BenOgorek
@BenOgorek 10 ай бұрын
Woo hoo!! 🎉 For future viewers, the tutorial code is the first link in the description, and you've got to bring your own mp4
@freewalker208
@freewalker208 Жыл бұрын
Many thanks! This save my day!
@relax_tube8458
@relax_tube8458 Жыл бұрын
Clear and easy to follow. Thanks !!!
@prajwal6379
@prajwal6379 7 ай бұрын
thank you I was trying From last 2 months
@sanvijain2641
@sanvijain2641 4 ай бұрын
Helped a lottt..thankyou!
@jasnarmstrng
@jasnarmstrng 4 ай бұрын
Really helpful. Thanks E!
@yuecheng1992
@yuecheng1992 Жыл бұрын
This is helpful, thanks!
@kanepickrel9388
@kanepickrel9388 Жыл бұрын
great video, thanks so much
@IsamAlHassan-t2e
@IsamAlHassan-t2e 9 ай бұрын
unfortunately it did not solve my problems on MacBook Pro
@black_n_brown
@black_n_brown Жыл бұрын
1 Vote up. Make video on how to download opencv using brew also compiling and running on terminal without linking issues! But overall well done!
@unev
@unev Жыл бұрын
I just typed 'brew install opencv' in the terminal and it has worked for me. I also installed cmake utility in the similar way.
@black_n_brown
@black_n_brown Жыл бұрын
​@@unev ooo ok. Seems like I may have tinkered a bit too much with my mac. Thanks tho 🙏
@ikechukwumichael1383
@ikechukwumichael1383 Жыл бұрын
A billion like bro. First video to work for me. Could you do tensorflow cpp for mac also? thanks
@elliotarledge
@elliotarledge Жыл бұрын
i dont do too much cpp anymore, likely the same process (download some file, make a cpp folder, write a make file that includes tensorflow, build, compile)
@mikkkkkeyyyyy
@mikkkkkeyyyyy 9 ай бұрын
thanks!!
@ghostoftsushimaps4150
@ghostoftsushimaps4150 Жыл бұрын
Thanks a lot. As you said it is not available at other places. I am beginner to cpp, not to coding though. One question that can't we generate object files directly without going through this make and all procedure.
@elliotarledge
@elliotarledge Жыл бұрын
You're welcome, I'm glad my tutorial was helpful to you! To answer your question, it is possible to generate object files directly without using a Makefile. However, using a Makefile provides a structured and automated way to compile and link your code, which can save you a lot of time and effort, especially as your project grows in complexity. In addition, Makefiles allow you to easily specify dependencies between files and only re-compile the necessary files when changes are made, which can be a big time-saver. That being said, if you prefer to generate object files manually, you can do so using a command like this `g++ -c main.cpp -o main.o` This will compile the main.cpp file and generate the main.o object file. You would then need to repeat this command for each source file in your project and link them together using another command. I hope this helps! Let me know if you have any other questions or concerns.
@Peymannazer
@Peymannazer 11 ай бұрын
Perfecttttttttttt
@ramavathjagadeesh1030
@ramavathjagadeesh1030 Жыл бұрын
hey its giving an zsh: command not found: cmake
@elliotarledge
@elliotarledge Жыл бұрын
Wouldn't know maybe look at stackoverflow or use gpt4
@Sir_Horus_ow
@Sir_Horus_ow 9 ай бұрын
When using the command "cmake .." it appears "zsh: command not found: cmake". ¿Why is that happening?
@elliotarledge
@elliotarledge 9 ай бұрын
first, make sure cmake is installed with `cmake -version` you could plug your errors into stackoverflow or ChatGPT and get a reasonable answer.
@Sir_Horus_ow
@Sir_Horus_ow 9 ай бұрын
@@elliotarledge I fixed that and finished this tutorial. I liked it. Thanks for the help!
@areggevorgyan1587
@areggevorgyan1587 4 ай бұрын
@@Sir_Horus_ow Im getting the same error how did you fix it
@sanvijain2641
@sanvijain2641 4 ай бұрын
hey..I'm facing the same issue...could you tell how did you fix it?
@bao-chaunguyen2344
@bao-chaunguyen2344 Жыл бұрын
I got a "Error: Could not open video file" is this the error referred to about the absolute reference? If so, how would I make it one? Thanks!
@elliotarledge
@elliotarledge Жыл бұрын
You could try that. Absolute reference means the entire path whereas relative can go from the cmd directory into sub directories. for example abs reference: C:/User/files/main.cpp. if you are in the files directory in the terminal you can use relative path /main.cpp. i get errors like this in python all the time haha
@kloselu4961
@kloselu4961 Жыл бұрын
@@elliotarledge I'm lost....so do change the file's path?
@m.4074
@m.4074 Жыл бұрын
How do I get rid of the include error?
@elliotarledge
@elliotarledge Жыл бұрын
I'm not sure without more context, can you provide the error you are receiving and the timestamp in which it happened in the video for you? Thanks.
@m.4074
@m.4074 Жыл бұрын
@@elliotarledge On last scene you have the same error. The red underline of the include statement. My program compiles with Make but VS Code tells me, that the open CV header isn’t found
@elliotarledge
@elliotarledge Жыл бұрын
@@m.4074 the point is too compile and run with cmake. If I were I'd just make sure all the necessary dependencies are installed and your env variables are correct. Those are the only errors I've gotten with cmake (I'm not super experiences with c/c++)
@m.4074
@m.4074 Жыл бұрын
@@elliotarledge ok thanks!
@jolen217
@jolen217 Жыл бұрын
This solution works for me: 1) updated c_cpp_properties.json file by adding "configurationProvider": "ms-vscode.cmake-tools"; 2) ran CMake: Configure command.
Установка opencv c++ vs22
8:11
Spajalica
Рет қаралды 11 М.
Coding Was Hard Until I Learned THESE 5 Things!
7:40
Pooja Dutt
Рет қаралды 1 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 109 МЛН
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 6 МЛН
Open CV C++ Mac M1 Installation Tutorial Video
12:51
Gleb Maksimov
Рет қаралды 9 М.
Run C++ and C in Visual Studio Code | Mac and Windows!
10:56
Caleb Curry
Рет қаралды 99 М.
Never* use git pull
4:02
Philomatics
Рет қаралды 501 М.
The Unreasonable Effectiveness of Linux Workstations
12:47
No Boilerplate
Рет қаралды 619 М.
My 2 Year Journey of Learning C, in 9 minutes
8:42
VoxelRifts (PixelRifts)
Рет қаралды 620 М.
Configuring C++ environment on Windows for OpenCV projects
17:33
Connor Monahan
Рет қаралды 18 М.
Become a shell wizard in ~12 mins
12:25
CODE IS EVERYTHING
Рет қаралды 251 М.
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 109 МЛН