An open API service indexing awesome lists of open source software.

https://github.com/pei-mao/cuda-erodeanddilate

This is a small implementation example of image processing using CUDA technology, demonstrating basic operation methods.
https://github.com/pei-mao/cuda-erodeanddilate

cuda-programming image-processing

Last synced: 11 months ago
JSON representation

This is a small implementation example of image processing using CUDA technology, demonstrating basic operation methods.

Awesome Lists containing this project

README

          

# Cuda-ErodeAndDilate
A small implementation of image processing operations (erosion and dilation) using CUDA for parallel computation.

| Raw Image | Erosion Image | Dilation Image |
|:---------:|:-------------:|:--------------:|
| ![Raw Image](images/finger.jpg) | ![Erosion Image](images/Erosion.jpg) | ![Dilation Image](images/Dilation.jpg) |

## Process

1. **Read the image**: Read the image from the specified path and convert it to grayscale.
2. **Allocate memory**: Allocate memory on the GPU to store the input and output image data.
3. **Set CUDA kernel parameters**: Define the number of threads per block and calculate the number of blocks needed.
4. **Execute CUDA kernel**: Execute the CUDA kernels for erosion and dilation operations.
5. **Retrieve results**: Copy the computed results from the GPU back to the CPU and save the resulting images to the specified path.
6. **Perform operations using OpenCV**: Perform erosion and dilation operations using OpenCV's `erode` and `dilate` functions, and save the results.