{"id":21766354,"url":"https://github.com/drilonaliu/parallel-image-scaling","last_synced_at":"2025-03-21T05:24:14.908Z","repository":{"id":264847956,"uuid":"849487152","full_name":"drilonaliu/Parallel-Image-Scaling","owner":"drilonaliu","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-29T17:25:46.000Z","size":4853,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T02:18:18.852Z","etag":null,"topics":["cuda","gpu","image-processing","scaling-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drilonaliu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T17:25:22.000Z","updated_at":"2024-10-10T22:01:23.000Z","dependencies_parsed_at":"2024-11-26T13:26:57.842Z","dependency_job_id":null,"html_url":"https://github.com/drilonaliu/Parallel-Image-Scaling","commit_stats":null,"previous_names":["drilonaliu/parallel-image-scaling"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drilonaliu%2FParallel-Image-Scaling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drilonaliu%2FParallel-Image-Scaling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drilonaliu%2FParallel-Image-Scaling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drilonaliu%2FParallel-Image-Scaling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drilonaliu","download_url":"https://codeload.github.com/drilonaliu/Parallel-Image-Scaling/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244741965,"owners_count":20502383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","gpu","image-processing","scaling-algorithms"],"created_at":"2024-11-26T13:16:55.642Z","updated_at":"2025-03-21T05:24:14.882Z","avatar_url":"https://github.com/drilonaliu.png","language":"Cuda","readme":"# Parallel-Image-Scaling\n\nImage Scaling is done with bilinear interpolation algorithm, which can be used both for scaling up or scaling down an image. Each thread corresponds to the pixels of the scaled image. In the sequential version, we iterate on each pixel of the scaled image. In the both versions we use inverse mapping, that is, we take pixels from the original image and paste them in the scaled version of the image. Below is given the kernel code for the image scaling. \n\n```\n/*\n* Kernel Method for scaling image using Billinear Interpolation.\n* \n* @param image - Uchar array of source image.\n* @param scaledImage - uchar array of the scaled image.\n* @param m - width scale.\n* @param n - height scale.\n* @param r - rows of source image.\n* @paarm c - coloumns of src image.\n*/\n__global__ void cudaScaleImage(uchar* image, uchar* scaledImage, int m, int n, int r, int c) {\n\tint thread_index = threadIdx.x + blockDim.x * blockIdx.x;\n\tif (thread_index \u003c m * n * r * c) {\n\t\tint i = thread_index % (m*r); //column\n\t\tint j = thread_index / (c*n); //row\n\t\tdouble a = (i - 1) * (r - 1) / (m * r - 1) + 1;\n\t\tdouble b = (j - 1) * (c - 1) / (n * c - 1) + 1;\n\n\t\tint  ii = round(a);\n\t\tint  jj = round(b);\n\n\t\tscaledImage[thread_index] = image[ii + r * jj];\n\n\t}\n}\n```\nIf we scale the image with a scale factor of 4, we get the resulting image.\n\n\u003cdiv\u003e\n \u003cimg src = \"readMeImages\\lena.jpg\"\u003e\n \u003cimg src = \"readMeImages\\scaledImage.jpg\"\u003e\n\u003c/div\u003e\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrilonaliu%2Fparallel-image-scaling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrilonaliu%2Fparallel-image-scaling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrilonaliu%2Fparallel-image-scaling/lists"}