Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Build Computer Vision Pipelines with OpenCV on 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.

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.

learning_objectives:
- Install and configure OpenCV on Google Cloud C4A Axion Arm64 instances
- Build image processing pipelines using OpenCV
- Develop video processing pipelines with real-time frame updates
- Visualize OpenCV outputs in the browser using an HTTP server
- Integrate OpenCV pipelines with machine learning models

prerequisites:
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
- Basic familiarity with Python and Linux command line
- Understanding of basic image/video processing concepts

author: Pareena Verma

##### Tags
skilllevels: Introductory
subjects: ML
cloud_service_providers:
- Google Cloud

armips:
- Neoverse

tools_software_languages:
- OpenCV
- Python
- NumPy
- Flask

operatingsystems:
- Linux

# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================

further_reading:
- resource:
title: OpenCV official documentation
link: https://docs.opencv.org/
type: documentation

- resource:
title: OpenCV GitHub repository
link: https://github.com/opencv/opencv
type: documentation

- resource:
title: NumPy documentation
link: https://numpy.org/doc/
type: documentation

weight: 1
layout: "learningpathall"
learning_path_main_page: yes
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# ================================================================================
# FIXED, DO NOT MODIFY THIS FILE
# ================================================================================
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
title: "Next Steps" # Always the same, html page title.
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Get started with OpenCV on Google Axion C4A
weight: 2

layout: "learningpathall"
---

## Explore Axion C4A Arm 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.

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

Key capabilities of OpenCV include:

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

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

In this section, you:

* 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

Next, you'll create a firewall rule to enable browser-based visualization of OpenCV pipelines running on your Arm-based virtual machine.d in this Learning Path.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---

title: Create a firewall rule for OpenCV Browser Visualization

weight: 3

### FIXED, DO NOT MODIFY

layout: learningpathall

---

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

{{% 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/).

{{% /notice %}}

## Configure the firewall rule

Navigate to the [Google Cloud Console](https://console.cloud.google.com/), go 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.

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

Set **Allow on match** to "Allow".

Set **Targets** to "Specified target tags".

Enter "allow-opencv" in the **Target tags** field.

Set **Source IPv4 ranges** to "0.0.0.0/0".

![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**.

Select the **TCP** checkbox and enter:

```text
8000
```

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

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

* Run image and video pipelines
* Integrate ML models with OpenCV
* Optimize performance on Arm-based systems
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: Create a Google Axion C4A Arm virtual machine on GCP
weight: 4

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

## Provision a Google Axion C4A Arm 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.

{{% 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/).
{{% /notice %}}

## Provision a Google Axion C4A Arm VM in Google Cloud Console

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.

![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.

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

![Google Cloud Console VM instances page showing the running C4A instance with a green status checkmark and the SSH button highlighted in the Connect column#center](images/gcp-pubip-ssh.png "Connecting to a running C4A VM using SSH")

A new browser window opens with a terminal connected to your VM.

![Browser-based SSH terminal window with black background showing Linux command prompt and Google Cloud branding at top#center](images/gcp-shell.png "Terminal session connected to the 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.

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