Skip to content

Commit bb52d18

Browse files
authored
Merge pull request #1438 from madeline-underwood/OpenCV_WoA
OpenCV_WoA_AP to review
2 parents eff37ec + 82f5bb7 commit bb52d18

File tree

5 files changed

+101
-81
lines changed

5 files changed

+101
-81
lines changed

content/learning-paths/laptops-and-desktops/win-opencv/1-opencv-compilers.md

Lines changed: 15 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,73 +8,33 @@ layout: learningpathall
88

99
## What is OpenCV?
1010

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.
1212

13-
Here’s what developers should know:
13+
Here are some of the benefits of using OpenCV:
1414

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.
1616

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.
1818

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.
2020

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:
2222

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.
2426

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.
2628

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.
2730

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)
4531

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?
6733

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.
7135

72-
* [Ninja]( https://github.com/ninja-build/ninja/releases)
36+
* __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.
7337

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.
7739

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.
7940

80-
You now have the required development tools installed. Please proceed to the page for the compiler you want to build with.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Setup
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
## Before you begin
9+
10+
You can use any Windows on Arm machine that has the required tools for this Learning Path.
11+
12+
The Learning Path shows you how to build OpenCV using MSVC or Clang.
13+
14+
Click on the links below for the tools download instructions.
15+
16+
### For both compilers
17+
18+
* [CMake](/install-guides/cmake).
19+
20+
{{% notice Note %}}
21+
This Learning Path was tested with CMake version 3.28.1.
22+
{{% /notice %}}
23+
24+
* [Git for Windows on Arm](/install-guides/git-woa).
25+
26+
### For MSVC
27+
28+
Follow the link to install the required tools for a method using MSVC.
29+
30+
* [Visual Studio 2022 or higher](/install-guides/vs-woa).
31+
32+
{{% notice Note %}}
33+
The instructions were tested with Visual Studio 2022.
34+
{{% /notice %}}
35+
36+
### For Clang
37+
38+
To build using Clang, install the following tools:
39+
40+
* [LLVM](/install-guides/llvm-woa/).
41+
42+
{{% notice Note %}}
43+
This Learning Path was tested with LLVM version 18.1.8.
44+
{{% /notice %}}
45+
46+
* [Ninja]( https://github.com/ninja-build/ninja/releases).
47+
48+
{{% notice Note %}}
49+
This Learning Path was tested with Ninja version 1.11.1.
50+
{{% /notice %}}
51+
52+
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.
53+
54+
You now have the required development tools installed. You can move on to the page for the compiler that you want to build with.

content/learning-paths/laptops-and-desktops/win-opencv/2-1-build-msvc.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Build OpenCV Applications with MSVC
3-
weight: 3
3+
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

99
## How do I build OpenCV with MSVC?
1010

11-
Follow the steps below to build OpenCV and a test application using the library with the MSVC compiler.
11+
Follow these steps to build OpenCV and a test application using the library with the MSVC compiler.
1212

1313
### Clone the OpenCV repository
1414

@@ -21,14 +21,14 @@ git checkout tags/4.10.0
2121
```
2222

2323
{{% notice Note %}}
24-
You might be able to use a later version, but these steps have been tested with the version 4.10.0.
24+
You might be able to use a later version, but these steps have been tested with version 4.10.0.
2525
{{% /notice %}}
2626

2727
### Pre-build configuration
2828

2929
You can use CMake from the command line.
3030

31-
First, run the following command to run the pre-build configuration.
31+
First, run the following command to run the pre-build configuration:
3232

3333
```bash
3434
mkdir build_msvc
@@ -51,7 +51,7 @@ cmake `
5151
-DWITH_CAROTENE=OFF
5252
```
5353

54-
The given options specify the following:
54+
The given options in the code above specify the following:
5555
- The source code is located one level above the current directory.
5656
- The build will be performed in the current directory.
5757
- The Visual Studio 2022 MSVC compiler will be used as the compiler.
@@ -108,12 +108,12 @@ cmake --build . --target INSTALL --config Release
108108
```
109109

110110
{{% notice Note %}}
111-
The build takes approximately 25 mins on a Lenovo X13s
111+
The build takes approximately 25 mins on a Lenovo X13s.
112112
{{% /notice %}}
113113

114114
 
115115

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:
117117

118118
```bash { output_lines = "2-12" }
119119
ls ./install/x64/vc17/bin
@@ -148,15 +148,15 @@ Mode LastWriteTime Length Name
148148

149149
The library used in your application is `opencv_world<version>.lib/dll`.
150150

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.
152152

153153
```bash { output_lines = "2" }
154154
./install/x64/vc17/bin/opencv_version.exe
155155
4.10.0
156156
```
157157

158158
{{% 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.
160160
{{% /notice %}}
161161

162162
&nbsp;
@@ -169,23 +169,23 @@ Once the OpenCV library has been successfully created, the next step is to link
169169

170170
First, create a new project in Visual Studio.
171171

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**.
173173

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.
175175

176-
Click `Create` to generate the new project.
176+
Click **Create** to generate the new project.
177177

178178
![MSVC project #center](msvc_project.png "Create a new project")
179179

180180
### Add source code
181181

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`.
183183

184184
![MSVC add file #center](msvc_add_file.png "Add a source file")
185185

186186
&nbsp;
187187

188-
Once the file is created, it will open in the editor.
188+
Once the file is created, it opens in the editor.
189189

190190
Copy and paste the following program into it and save the file.
191191

@@ -205,17 +205,25 @@ int main() {
205205
}
206206
```
207207

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.
209213

210214
### Configure build settings
211215

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.
213217

214218
![MSVC screenshot #center](msvc_screen.png "MSVC screenshot")
215219

216220
&nbsp;
217221

218-
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**.
219227

220228
![MSVC include dir #center](msvc_include_dir.png "Include directories: Specify the directory containing the OpenCV header files.")
221229

@@ -237,7 +245,7 @@ Finally, ensure that the directory containing the dynamic libraries (DLLs) is ad
237245

238246
You are now ready to build the application.
239247

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.
241249

242250
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.
243251

content/learning-paths/laptops-and-desktops/win-opencv/2-2-build-clang.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Once the library files are correctly generated, run the following command to ens
162162

163163
Once the OpenCV library has been successfully created, you can create a simple application and try using it.
164164

165-
### Prepare a application program
165+
### Prepare an application program
166166

167167
First, use a text editor to save the following C++ program as `test_opencv.cpp` in the `build_clang` directory.
168168

@@ -216,7 +216,7 @@ Run the test program:
216216
.\test_opencv.exe
217217
```
218218

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.
220220

221221
Open the image file, it should look like the example shown below.
222222

content/learning-paths/laptops-and-desktops/win-opencv/_index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
2-
title: Build OpenCV applications on Windows on Arm
3-
draft: true
4-
cascade:
5-
draft: true
2+
title: Create OpenCV applications on Windows on Arm
3+
64
minutes_to_complete: 90
75

8-
who_is_this_for: This is an advanced topic for software developers who want to use OpenCV with Windows on Arm devices.
6+
who_is_this_for: This is an advanced topic for software developers who want to build and develop applications on Windows on Arm devices using OpenCV.
97

108
learning_objectives:
119
- Build the OpenCV library for Windows on Arm devices.
1210
- Develop applications using OpenCV.
1311

1412
prerequisites:
15-
- A Windows on Arm computer such as Lenovo Thinkpad X13s or an [Azure virtual machine](/learning-paths/cross-platform/woa_azure/).
13+
- A Windows on Arm machine such as the Lenovo Thinkpad X13s, or an [Azure virtual machine](/learning-paths/cross-platform/woa_azure/).
1614

1715
author_primary: Koki Mitsunami
1816

0 commit comments

Comments
 (0)