Skip to content
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
---
title: Build Computer Vision Pipelines with OpenCV on Google Cloud C4A Axion VM
title: Build computer vision pipelines with OpenCV on a Google Cloud C4A Axion VM
description: Deploy and run OpenCV-based computer vision pipelines on Google Cloud Axion C4A Arm-based VMs, covering image processing, video pipelines, browser-based visualization, and integration with machine learning models.

draft: true
cascade:
draft: true


minutes_to_complete: 45

who_is_this_for: This is an introductory topic for DevOps engineers, software developers, and AI practitioners who want to build and run computer vision pipelines on SUSE Linux Enterprise Server (SLES) Arm64 using OpenCV, process images and videos, visualize outputs in real time, and integrate ML models.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,35 @@
---
title: Get started with OpenCV on Google Axion C4A
title: Understand OpenCV on Google Axion C4A
weight: 2

layout: "learningpathall"
---

## Explore Axion C4A Arm instances in Google Cloud
## Arm-based Axion C4A instances in Google Cloud

Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.

The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
The C4A series provides a cost-effective alternative to x86 virtual machines while using the scalability and performance benefits of the Arm architecture in Google Cloud.

To learn more, see the Google blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu).

## Explore OpenCV on Google Axion C4A (Arm Neoverse V2)
## OpenCV on Google Axion C4A

OpenCV (Open Source Computer Vision Library) is a widely used open-source library for building real-time computer vision and image processing applications. It provides optimized implementations for image transformations, video processing, object detection, and integration with machine learning models.
Open Source Computer Vision Library (OpenCV) is an open-source library for real-time computer vision and image processing applications. It includes implementations for image transforms, video processing, object detection, and integration with machine learning models.

Key capabilities of OpenCV include:
When you run OpenCV on Google Axion C4A infrastructure, you can use multi-core CPU parallelism to scale image and video workloads on Arm. In practice, this helps you:

* **Image Processing** for transformations, filtering, and feature extraction
* **Video Processing** for frame-by-frame analysis and real-time pipelines
* **Drawing & Visualization** for overlaying text, shapes, and annotations
* **ML Integration** for combining computer vision with machine learning models

Running OpenCV on Google Axion C4A Arm-based infrastructure enables efficient execution of image and video workloads by leveraging multi-core CPU parallelism. This allows:

* Faster frame processing for video pipelines
* Efficient memory utilization for image transformations
* Improved performance-per-watt compared to x86 systems
* Cost-effective scaling for computer vision workloads
* Process video frames faster in CPU-based pipelines
* Use memory efficiently for common image transformations
* Improve performance-per-watt for sustained processing jobs
* Scale vision services in cloud environments with predictable costs

Common use cases include real-time video analytics, image transformation pipelines, automated inspection systems, and ML-powered vision applications.

To learn more, visit the [OpenCV documentation](https://docs.opencv.org/) and explore the [OpenCV GitHub repository](https://github.com/opencv/opencv).

## What you've accomplished and what's next
To learn more, see the [OpenCV documentation](https://docs.opencv.org/) and explore the [OpenCV GitHub repository](https://github.com/opencv/opencv).

In this section, you:
## What you've learned and what's next

* Explored Google Axion C4A Arm-based VMs and their benefits for computer vision workloads
* Understood OpenCV capabilities for image and video processing
* Learned how Arm architecture improves performance and efficiency for OpenCV pipelines
You've now reviewed what Google Axion C4A instances provide on Arm and why they are a good fit for OpenCV workloads. You also mapped OpenCV capabilities to practical cloud use cases you can run on C4A.

Next, you'll create a firewall rule to enable browser-based visualization of OpenCV pipelines running on your Arm-based virtual machine.
Next, you'll create a firewall rule so you can view OpenCV pipeline output from your browser while your application runs on an Arm-based virtual machine.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

title: Create a firewall rule for OpenCV Browser Visualization
title: Create a firewall rule for OpenCV browser visualization

weight: 3

Expand All @@ -9,34 +9,36 @@ weight: 3
layout: learningpathall

---

Create a firewall rule in Google Cloud Console to expose the required port for OpenCV browser-based visualization.

## Expose port for OpenCV browser-based visualization

Create a firewall rule in Google Cloud Console to allow browser access to your OpenCV output on port 8000.

{{% notice Note %}}

For help with GCP setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/).
For help with Google Cloud Platform setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/).

{{% /notice %}}

## Configure the firewall rule
### Configure the firewall rule

Configure the firewall rule using the Google Cloud Console:

Navigate to the [Google Cloud Console](https://console.cloud.google.com/), go to **VPC Network > Firewall**, and select **Create firewall rule**.
1. Open the [Google Cloud Console](https://console.cloud.google.com/), navigate to **VPC Network > Firewall**, and select **Create firewall rule**.

![Google Cloud Console VPC Network Firewall page showing the Create firewall rule button in the top menu bar#center](images/firewall-rule.png "Create a firewall rule in Google Cloud Console")

Next, create the firewall rule that exposes the required port for OpenCV visualization.
2. Set the **Name** of the new rule to **allow-opencv-port**. Select the network that you intend to bind to your VM.

Set the **Name** of the new rule to "allow-opencv-port". Select your network that you intend to bind to your VM.

Set **Direction of traffic** to "Ingress".
3. For **Direction of traffic**, select **Ingress**.

Set **Allow on match** to "Allow".
4. For **Allow on match**, select **Allow**.

Set **Targets** to "Specified target tags".
5. For **Targets**, select **Specified target tags**.

Enter "allow-opencv" in the **Target tags** field.
6. For **Target tags**, enter **allow-opencv**.

Set **Source IPv4 ranges** to your current machine's public IP address. Run the following command in a terminal on your local machine (not on the VM) to find it:
7. Set **Source IPv4 ranges** to your current machine's public IP address. Run the following command in a terminal on your local machine to find the address:

```bash
curl -4 ifconfig.me
Expand All @@ -48,29 +50,17 @@ The `-4` flag forces an IPv4 response. Take the returned address and append `/32

![Google Cloud Console Create firewall rule form configured for OpenCV with Ingress and Allow settings#center](images/network-rule.png "Configuring the OpenCV firewall rule")

## Configure port

Under **Protocols and ports**, select **Specified protocols and ports**.
8. For **Protocols and ports**, select **Specified protocols and ports**.

Select the **TCP** checkbox and enter:
9. Select the **TCP** checkbox and, for **Ports**, enter **8000**.

```text
8000
```
10. Select **Create**.

Then select **Create**.

![Google Cloud Console Protocols and ports section showing TCP checkbox selected with port 8000 configured for OpenCV Browser Visualization#center](images/network-port.png "Setting Ray ports in the firewall rule")
![Google Cloud Console Protocols and ports section showing TCP checkbox selected with port 8000 configured for OpenCV browser visualization#center](images/network-port.png "Setting ports in the firewall rule")

## What you've accomplished and what's next
In this section, you:

* Created a firewall rule for OpenCV visualization
* Enabled external browser access to your VM
* Exposed port 8000 for real-time pipeline outputs

Next, you'll:
You've now created a firewall rule for OpenCV visualization that enables external browser access to your VM and exposes port 8000 for real-time pipeline outputs.

* Run image and video pipelines
* Integrate ML models with OpenCV
* Optimize performance on Arm-based systems
Next, you'll create a Google Axion virtual machine to host your OpenCV application.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: Create a Google Axion C4A Arm virtual machine on GCP
title: Create a Google Axion C4A Arm virtual machine
weight: 4

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Provision a Google Axion C4A Arm VM
## Provision a Google Axion C4A Arm-based VM

In this section, you'll create a Google Axion C4A Arm-based virtual machine on Google Cloud Platform. You'll use the `c4a-standard-4` machine type, which provides 4 vCPUs and 16 GB of memory. This VM will host your OpenCV application.
In this section, you'll create a Google Axion C4A Arm-based virtual machine (VM) on Google Cloud Platform (GCP). You'll use the `c4a-standard-4` machine type with four vCPUs and 16 GB of memory. This VM will host your OpenCV application.

{{% notice Note %}}
For help with GCP setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/).
Expand All @@ -18,22 +18,21 @@ For help with GCP setup, see the Learning Path [Getting started with Google Clou

To create a virtual machine based on the C4A instance type:

- Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
- Go to **Compute Engine** > **VM Instances** and select **Create Instance**.
- Under **Machine configuration**:
- Populate fields such as **Instance name**, **Region**, and **Zone**.
- Set **Series** to `C4A`.
- Select `c4a-standard-4` for machine type.
1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
2. Go to **Compute Engine** > **VM Instances** and select **Create Instance**.
3. Under **Machine configuration**:
- Populate fields such as **Instance name**, **Region**, and **Zone**.
- Set **Series** to `C4A`.
- Select `c4a-standard-4` for **Machine type**.

![Screenshot of the Google Cloud Console showing the Machine configuration section. The Series dropdown is set to C4A and the machine type c4a-standard-4 is selected#center](images/gcp-vm.png "Configuring machine type to C4A in Google Cloud Console")

- Under **OS and storage**, select **Change**, and then choose an Arm64-based operating system image.
- For this Learning Path, select **SUSE Linux Enterprise Server**.
- For the license type, choose **Pay as you go**.
- Increase **Size (GB)** from **10** to **100** to allocate sufficient disk space.
- Select **Choose** to apply the changes.
- Expand the **Networking** section and enter `allow-opencv` in the **Network tags** field. This tag links the VM to the firewall rule you created earlier, enabling external access to the OpenCV Dashboard and Serve API ports.
- Select **Create** to launch the virtual machine.
4. Under **OS and storage**, select **Change**, and then choose an Arm64-based operating system image. For this Learning Path, select **SUSE Linux Enterprise Server**.
- For the license type, choose **Pay as you go**.
- Increase **Size (GB)** from **10** to **100** to allocate sufficient disk space.
- Select **Choose** to apply the changes.
5. Expand the **Networking** section and enter `allow-opencv` in the **Network tags** field. This tag links the VM to the firewall rule you created earlier, so your browser can access the OpenCV output.
6. Select **Create** to launch the virtual machine.

After the instance starts, select **SSH** next to the VM in the instance list to open a browser-based terminal session.

Expand All @@ -45,6 +44,6 @@ A new browser window opens with a terminal connected to your VM.

## What you've accomplished and what's next

In this section, you provisioned a Google Axion C4A Arm VM and connected to it using SSH.
You've now provisioned a Google Axion C4A Arm VM and connected to it using SSH. You'll use this VM to run your OpenCV application.

Next, you'll install OpenCV and the required dependencies on your VM.
Loading
Loading