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.
- Host: GitHub
- URL: https://github.com/pei-mao/cuda-erodeanddilate
- Owner: Pei-mao
- Created: 2024-07-10T04:44:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-18T02:55:49.000Z (almost 2 years ago)
- Last Synced: 2025-01-02T23:19:37.158Z (over 1 year ago)
- Topics: cuda-programming, image-processing
- Language: C++
- Homepage:
- Size: 639 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 |
|:---------:|:-------------:|:--------------:|
|  |  |  |
## 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.