Skip to content

This repository demonstrates image processing using OpenCV with CUDA for GPU acceleration on Google Colab. It includes basics like displaying and manipulating images, alongside advanced techniques using CUDA to enhance performance. Ideal for learning GPU-accelerated image processing in Python.

License

Notifications You must be signed in to change notification settings

BhavinPatel4199/Image-Processing-with-OpenCV-and-CUDA-on-Google-Colab

Repository files navigation

Image Processing with OpenCV and CUDA on Google Colab

This repository contains a Jupyter notebook that demonstrates various image processing techniques using OpenCV, with a focus on leveraging GPU acceleration through CUDA on Google Colab. The notebook covers the basics of working with images, including displaying images, manipulating pixel data, and utilizing CUDA for enhanced performance.

Table of Contents

Introduction

Images are composed of pixels, each with attributes like location, color, and proximity to other pixels. OpenCV (Open Source Computer Vision Library) is a popular tool in the machine learning community for image processing. This notebook demonstrates how to use OpenCV in Python, particularly focusing on the integration of CUDA for GPU-accelerated image processing.

Setup and Requirements

To run this notebook, you will need the following:

  • Google Colab (recommended due to the GPU support)
  • OpenCV with CUDA support
  • Python libraries: cv2, numpy, matplotlib, PIL

Installing Dependencies

The notebook includes steps for setting up OpenCV with CUDA on Google Colab. This involves installing the necessary dependencies, cloning the OpenCV repositories, configuring the build with CMake, and compiling the source code.

Usage

This notebook showcases several key functionalities:

  1. Displaying Images: Methods for displaying images using OpenCV and IPython.
  2. Image Manipulation: Techniques for manipulating pixel data, such as converting images to grayscale or altering color channels.
  3. Random Image Generation: Creation of random images using numpy arrays and saving them as files.
  4. GPU Acceleration: Usage of CUDA-enabled functions in OpenCV to accelerate image processing tasks.

CUDA Acceleration

OpenCV provides CUDA-enabled libraries that significantly speed up image processing tasks by utilizing the GPU. This notebook contains examples of:

  • Applying Contrast Limited Adaptive Histogram Equalization (CLAHE) using both CPU and GPU versions.
  • The setup and processing differences when using CUDA in OpenCV.

Running the Notebook

  1. Open the notebook in Google Colab.
  2. Follow the instructions to mount your Google Drive (if needed).
  3. Install the required dependencies and set up OpenCV with CUDA.
  4. Execute the cells sequentially to understand and apply various image processing techniques.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

Clone the Repository:

git clone https://github.com/krishnapatel1722/Image-Processing-with-OpenCV-and-CUDA-on-Google-Colab.git

About

This repository demonstrates image processing using OpenCV with CUDA for GPU acceleration on Google Colab. It includes basics like displaying and manipulating images, alongside advanced techniques using CUDA to enhance performance. Ideal for learning GPU-accelerated image processing in Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published