Opencv Macos
Opencv Macos
$ OpenCV C++
Mac
!
Video Tutorial
OpenCV C++ < Installations – Windows and Mac < Mac IN PROGRESS
Code – Projects
# 4 Topics
# Step 3 – Create New Xcode Project
1 Open X code and create a "macOS" - "Command Line Tool" - "C++"
Download Resources 2
Test Code
1 #include <opencv2/imgcodecs.hpp>
2 #include <opencv2/highgui.hpp>
3 #include <opencv2/imgproc.hpp>
4 #include <iostream>
5
6 using namespace cv;
7 using namespace std;
8
9
10 ///////////////// Images //////////////////////
11
12 int main() {
13
14 string path = "Resources/test.png";
15 Mat img = imread(path);
16 imshow("Image", img);
17 waitKey(0);
18 return 0;
19 }
Add new
Item: NSCameraUsageDescription
Value: $(PRODUCT_NAME) camera use
Open Products folder and right click on the file with your project name and
show in finder.
TEST CODE
1 #include <opencv2/imgcodecs.hpp>
2 #include <opencv2/highgui.hpp>
3 #include <opencv2/imgproc.hpp>
4 #include <iostream>
5
6 using namespace cv;
7 using namespace std;
8
9 ///////////////// Webcam //////////////////////
10
11 int main() {
12
13 VideoCapture cap(1);
14 Mat img;
15
16 while (true) {
17
18 cap.read(img);
19 imshow("Image", img);
20 waitKey(1);
21
22 }
23 return 0;
24 }