This project aims to provide hands-on experience with parallel and distributed computing using OpenCL by converting a dataset of colored images of skin lesions into grayscale images. Specifically, it focuses on processing images from "The ISIC 2020 Challenge Dataset" to aid in early skin cancer detection and diagnosis.
The objective of this project is to convert the ISIC 2020 Challenge Dataset, which consists of dermoscopic images of skin lesions, into grayscale images using OpenCL parallel computing. By converting these images to grayscale, the complexity is reduced, facilitating tasks such as lesion segmentation and aiding in computational efficiency.
The ISIC dataset is a crucial resource for dermatology and medical image analysis, offering a diverse collection of high-quality skin lesion images. It supports the development of diagnostic systems, segmentation algorithms, and deep learning models for automated lesion detection and classification. Converting these images to grayscale simplifies image representation and aids in analysis and processing.
Test Set available at containing 10,982 JPEG images of different sizes: https://isic-challenge-data.s3.amazonaws.com/2020/ISIC_2020_Test_JPEG.zip
You are provided with a dataset of colored images of skin lesions in JPEG format. The task is to convert these colored images to grayscale images using OpenCL parallel computing.
-
Install WSL (Windows Subsystem for Linux):
- Open PowerShell or terminal as administrator and run:
wsl --install
-
Clone the repository to your local machine.
-
Download the stb_image and stb_image_write .h files from the github link. Click here.
-
Navigate to the clonned directory; paste the .h files; update package list and install necessary packages:
cd Parallel-ImageProcessing-OpenCL sudo apt-get update && \ sudo apt-get install -y pocl-opencl-icd ocl-icd-opencl-dev gcc clinfo
-
Check available OpenCL devices:
clinfo
-
If your Intel integrated GPU doesn't appear, run:
sudo apt install intel-opencl-icd
gcc host.c -o host -lm -lOpenCL
./host
Update the paths for the input and output images in host.c
:
// Specify the input and output image paths
const char* inputPath = "";
const char* outputPath = "";
// Select the Platform Id
err = clGetPlatformIDs(1, &platform_id, NULL);
// Select the Device Id
err |= clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU, 1, &device_id, NULL);
// Select the local group size according to your gpu hardware.
// Max work group size 256 => (Intel(R) UHD Graphics 620)
localSize[0] = 16;
localSize[1] = 16;