You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-opencv/1-opencv-compilers.md
+15-55Lines changed: 15 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,73 +8,33 @@ layout: learningpathall
8
8
9
9
## What is OpenCV?
10
10
11
-
OpenCV (Open Source Computer Vision Library) is a popular, open-source library that developers use to build computer vision applications. It provides a set of tools and functions that help you handle tasks related to images and videos without needing to write everything from scratch.
11
+
Open Source Computer Vision Library (OpenCV) is a popular, Open Source library that developers can use to build computer vision applications. It provides a set of tools and functions that can help you with tasks handling images and videos.
12
12
13
-
Here’s what developers should know:
13
+
Here are some of the benefits of using OpenCV:
14
14
15
-
*__Ease of Use__: OpenCV comes with pre-built functions for common tasks like reading, displaying, and processing images and videos. This saves time compared to writing algorithms from the ground up.
15
+
*__Ease of Use__: OpenCV comes with pre-built functions for common tasks such as reading, displaying, and processing images and videos. This saves time compared to needing to cover absolutely every detail when writing an algorithm.
16
16
17
-
*__Image Processing__: You can perform operations like changing colors, applying filters, resizing, rotating, and other transformations to images with minimal code.
17
+
*__Image Processing__: You can perform operations such as changing colors, applying filters, resizing, rotating, and make other transformations to images with minimal coding effort.
18
18
19
-
*__Video Handling__: Developers can use OpenCV to capture, modify, and analyze video frames, making it ideal for creating applications like video surveillance or video editing tools.
19
+
*__Video Handling__: Developers can use OpenCV to capture, modify, and analyze video frames, making it ideal for creating applications such as video surveillance or video editing tools.
20
20
21
-
*__Computer Vision Algorithms__: OpenCV includes built-in algorithms for complex tasks like object detection (e.g., face and eye recognition), edge detection, and image segmentation.
21
+
*__Computer Vision Algorithms__: OpenCV includes built-in algorithms for complex tasks such as:
22
22
23
-
*__Machine Learning__: It includes modules for training models using basic machine learning algorithms, which can be applied for pattern recognition and data analysis in visual data.
23
+
* Object detection; for example, face and eye recognition.
24
+
* Edge detection.
25
+
* Image segmentation.
24
26
25
-
*__Community and Resources__: Being open-source and widely adopted, there is a large community of developers contributing to and supporting OpenCV. This makes it easier to find tutorials, documentation, and answers to questions.
27
+
*__Machine Learning__: OpenCV includes modules for training models using basic machine learning algorithms, which can be applied for pattern recognition and data analysis in visual data.
26
28
29
+
*__Community and Resources__: As OpenCV is Open Source and widely adopted, there is a large community of developers both contributing to, and supporting, OpenCV. This makes it easier to find tutorials, documentation, and answers to questions, as there are many resources available.
27
30
28
-
## Which compilers are available for Windows on Arm Development?
29
-
30
-
MSVC (Microsoft Visual C++) and Clang are options for developers building Windows on Arm applications.
31
-
32
-
*__MSVC__: A compiler developed by Microsoft that’s part of the Visual Studio IDE. It’s designed specifically for Windows and integrates well with the Windows development ecosystem.
33
-
34
-
*__Clang__: An open-source compiler that is part of the LLVM project. It’s known for its modern design and cross-platform capabilities.
35
-
36
-
MSVC is ideal for Windows-focused projects needing seamless integration with Visual Studio. Clang is ideal for cross-platform projects or when using modern C++ features.
37
-
38
-
## Before you begin
39
-
40
-
Any Windows on Arm machine which has the required tools installed can be used for this Learning Path. You will learn how to build OpenCV using both MSVC and Clang.
41
-
42
-
Please install the following tools required for both methods.
43
-
44
-
*[CMake](/install-guides/cmake)
45
31
46
-
{{% notice Note %}}
47
-
The instructions were tested with the version 3.28.1
48
-
{{% /notice %}}
49
-
50
-
*[Git](https://git-scm.com/downloads/win)
51
-
52
-
{{% notice Note %}}
53
-
There is currently no Arm version of Git. Install the 64-bit x86 version.
54
-
{{% /notice %}}
55
-
56
-
Follow the link to install the required tools for a method using MSVC.
57
-
58
-
*[Visual Studio 2022 or higher](/install-guides/vs-woa).
59
-
60
-
{{% notice Note %}}
61
-
The instructions were tested with Visual Studio 2022.
62
-
{{% /notice %}}
63
-
64
-
To build using Clang, please install the following.
65
-
66
-
*[LLVM](/install-guides/llvm-woa/)
32
+
## Which compilers are available for Windows on Arm Development?
67
33
68
-
{{% notice Note %}}
69
-
The instructions were tested with the version 18.1.8.
70
-
{{% /notice %}}
34
+
MSVC (Microsoft Visual C++) and Clang are both compilers that are available for developers building Windows on Arm applications.
*__MSVC__: Developed by Microsoft, MSVC is a compiler that is part of the Visual Studio IDE. It is designed specifically for Windows, and integrates well with the Windows development ecosystem. MSVC is ideal for Windows-focused projects requiring seamless integration with Visual Studio.
73
37
74
-
{{% notice Note %}}
75
-
The instructions were tested with version 1.11.1
76
-
{{% /notice %}}
38
+
*__Clang__: Part of the LLVM project, Clang is an Open Source compiler that is known for its modern design and cross-platform capabilities. Clang is better suited to cross-platform projects, or when using modern C++ features.
77
39
78
-
Make sure LLVM Clang and Ninja are in your search path. If they are not, you can use Windows Control Panel to set the PATH environment variable.
79
40
80
-
You now have the required development tools installed. Please proceed to the page for the compiler you want to build with.
The build takes approximately 25 mins on a Lenovo X13s
111
+
The build takes approximately 25 mins on a Lenovo X13s.
112
112
{{% /notice %}}
113
113
114
114
115
115
116
-
When the build and the install steps are complete, confirm the shared library has been created by inspecting the results in the `install/bin` directory:
116
+
When you have completed the build and installation steps, confirm the shared library has been created by inspecting the results in the `install/bin` directory:
117
117
118
118
```bash { output_lines = "2-12" }
119
119
ls ./install/x64/vc17/bin
@@ -148,15 +148,15 @@ Mode LastWriteTime Length Name
148
148
149
149
The library used in your application is `opencv_world<version>.lib/dll`.
150
150
151
-
Once the library files are correctly generated, run the following command to ensure there are no errors.
151
+
Once the library files are correctly generated, run the following command to ensure that there are no errors.
152
152
153
153
```bash { output_lines = "2" }
154
154
./install/x64/vc17/bin/opencv_version.exe
155
155
4.10.0
156
156
```
157
157
158
158
{{% notice Note %}}
159
-
The genereated directory name contains "x64," but there is no need to worry as the libraries and executable files will definitely run as ARM64.
159
+
The generated directory name contains "x64," but there is no need to worry as the libraries and executable files will definitely run as AArch64.
160
160
{{% /notice %}}
161
161
162
162
@@ -169,23 +169,23 @@ Once the OpenCV library has been successfully created, the next step is to link
169
169
170
170
First, create a new project in Visual Studio.
171
171
172
-
Launch Visual Studio, click `Create a new project` on the initial screen, then select `Empty Project` and click `Next`.
172
+
Launch Visual Studio, click **Create a new project** on the initial screen, then select **Empty Project**, and click **Next**.
173
173
174
-
On the next screen, set the `Project name` and `Location`. You can choose any name and location, but for this example, name the project `TestOpenCV`, as shown below.
174
+
On the next screen, set the **Project name** and **Location**. You can choose any name and location, but for this example, name the project `TestOpenCV`, as shown below.
175
175
176
-
Click `Create` to generate the new project.
176
+
Click **Create** to generate the new project.
177
177
178
178

179
179
180
180
### Add source code
181
181
182
-
In `Solution Explorer`, right-click the `Source Files` folder, select `Add`, and then `New Item...`. Create a file named `test_opencv.cpp`.
182
+
In **Solution Explorer**, right-click the **Source Files** folder, select **Add**, and then **New Item...**. Create a file named `test_opencv.cpp`.
183
183
184
184

185
185
186
186
187
187
188
-
Once the file is created, it will open in the editor.
188
+
Once the file is created, it opens in the editor.
189
189
190
190
Copy and paste the following program into it and save the file.
191
191
@@ -205,17 +205,25 @@ int main() {
205
205
}
206
206
```
207
207
208
-
This program is a simple example that uses OpenCV to create a 100x100 black image, draw a blue circle on it, and save it as a file.
208
+
This program is a simple example that uses OpenCV to do the following:
209
+
210
+
* Create a 100x100 black image.
211
+
* Draw a blue circle on it.
212
+
* Save it as a file.
209
213
210
214
### Configure build settings
211
215
212
-
Next, select the `Configuration` dropdown menu in the center of the screen and change it from `Debug` to `Release`. At this stage, your screen should look like the example shown below.
216
+
Next, select the **Configuration** drop-down menu in the center of the screen, and change it from **Debug** to **Release**. At this stage, your screen should look like the example shown below.
Now, set up the compile and link settings. Select `Project` from the top menu and click on `TestOpenCV properties`. Edit `Include directories`, `Library directories`, and `Additional dependencies` as shown in the images below, and then click OK.
222
+
Now, set up the compile and link settings.
223
+
224
+
Select **Project** from the top menu and click on **TestOpenCV properties**.
225
+
226
+
Edit **Include directories**, **Library directories**, and **Additional dependencies** as shown in the images below, and then click **OK**.
219
227
220
228

221
229
@@ -237,7 +245,7 @@ Finally, ensure that the directory containing the dynamic libraries (DLLs) is ad
237
245
238
246
You are now ready to build the application.
239
247
240
-
From the top menu, select `Debug` and click `Start Without Debugging` or press `Ctrl` + `F5`.
248
+
From the top menu, select **Debug** and click **Start Without Debugging** or press Ctrl+F5.
241
249
242
250
If a console window appears showing that the program exited with code 0 and `test_image.png` is generated in the top-level directory of your Visual Studio project, you have succeeded.
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-opencv/2-2-build-clang.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,7 +162,7 @@ Once the library files are correctly generated, run the following command to ens
162
162
163
163
Once the OpenCV library has been successfully created, you can create a simple application and try using it.
164
164
165
-
### Prepare a application program
165
+
### Prepare an application program
166
166
167
167
First, use a text editor to save the following C++ program as `test_opencv.cpp` in the `build_clang` directory.
168
168
@@ -216,7 +216,7 @@ Run the test program:
216
216
.\test_opencv.exe
217
217
```
218
218
219
-
When you execute the command, it will finish quickly, and `test_image.png` is generated. If you don't have the DLL directory in your search path, the program appears to run, but no `test_image.png` is generated.
219
+
When you execute the command, it will finish quickly, and `test_image.png` is generated. If you do not have the DLL directory in your search path, the program appears to run, but no `test_image.png` is generated.
220
220
221
221
Open the image file, it should look like the example shown below.
0 commit comments