{"id":17384464,"url":"https://github.com/jakubriegel/convolution_filter","last_synced_at":"2025-06-19T10:34:24.390Z","repository":{"id":40973648,"uuid":"229737030","full_name":"jakubriegel/convolution_filter","owner":"jakubriegel","description":"Concurrent implementation of image convolution filter using Python's multiprocessing","archived":false,"fork":false,"pushed_at":"2023-10-03T21:39:29.000Z","size":130,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T23:41:59.553Z","etag":null,"topics":["concurrency","image-filtering","image-processing","multiprocessing","python-multiprocessing"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/jakubriegel.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":"2019-12-23T11:15:46.000Z","updated_at":"2020-01-21T10:54:53.000Z","dependencies_parsed_at":"2024-12-06T19:44:13.096Z","dependency_job_id":"6d27a8c1-96df-4ba8-ace9-f2bf40030dc2","html_url":"https://github.com/jakubriegel/convolution_filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2Fconvolution_filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2Fconvolution_filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2Fconvolution_filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2Fconvolution_filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakubriegel","download_url":"https://codeload.github.com/jakubriegel/convolution_filter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924500,"owners_count":20694731,"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":["concurrency","image-filtering","image-processing","multiprocessing","python-multiprocessing"],"created_at":"2024-10-16T07:45:33.270Z","updated_at":"2025-03-27T21:18:25.025Z","avatar_url":"https://github.com/jakubriegel.png","language":"Python","readme":"# convolution filter\n## about\nConcurrent implementation of `.ppm` images convolution filter. \nThe application uses Python `multiprocessing` module for concurrency and `numpy.array` for image processing.\n\n## table of contents\n  * [about](#about)\n  * [run it](#run-it)\n  * [cli](#cli)\n    + [filter mode](#filter-mode)\n      - [info](#info)\n      - [command](#command)\n      - [arguments](#arguments)\n      - [example](#example)\n    + [benchmark mode](#benchmark-mode)\n      - [info](#info-1)\n      - [command](#command-1)\n      - [arguments](#arguments-1)\n      - [example](#example-1)\n  * [algorithm](#algorithm)\n    + [the filter](#the-filter)\n    + [concurrency](#concurrency)\n  * [sample benchmark](#sample-benchmark)\n    + [machine](#machine)\n    + [parameters](#parameters)\n    + [results](#results)\n  * [credits](#credits)\n\n## run it\nTo run the app first create the virtual environment:\n```\npython -m venv cf-venv\n```\n\nThen start the environment:\n```\nsource cf-venv/bin/activate \n```\n\nNext install dependencies:\n```\npip install -r requirements.txt\n```\n\nStart the app:\n```\npython conv.py [ARGS]\n```\n\n## cli\n### filter mode\n#### info\nIn this mode the app applies convolution filer to given image.\n\n#### command\n```\npython conv.py [IMAGE] [BLUR] [NUMBER_OF_WORKERS] [MEASURE_TIME?]\n```\n\n#### arguments\n* IMAGE - name of image file to apply filter on\n* BLUR - choose blur matrix to use\n* NUMBER_OF_WORKERS - number of workers (processes) to use\n* MEASURE_TIME - optional, `t` for printing execution time\n\n#### example\n```\npython conv.py image.ppm blur1 8 1 t\n```\n\n### benchmark mode\n#### info\nIn this mode the app applies convolution filer many times on consecutive numbers of workers.\nTime results are being printed as `csv` to standard output. \n\n#### command\n```\npython conv.py bench [IMAGE] [MAX_WORKERS] [MAX_ITERATIONS]\n```\n\n#### arguments\n* IMAGE - name of image file to apply filter on\n* MAX_WORKERS - maximal number of workers to run benchmark on\n* MAX_ITERATIONS - maximal number of iteration to run benchmark on\n\n#### example\n```\npython conv.py bench image.ppm 12 50\n```\n\n## algorithm\n## the filter\nConvolution filter is used to blur or sharpen images. This effect is achieved by substituting each pixel by weighted arithmetic mean of it and its neighbours.\nThe type and strength of filter can be adjusted using different weights. In this implementation they are represented as matrix stored in `conv.api.MATRIX`.\n\n## concurrency\nResult of computation is a set of results of computing individual pixels. Each pixel result is depending only of state of its neighbours.\nThat makes this problem perfect for concurrent computations. \n\nSource image is divided into `n` slices, where `n` is the number of concurrent workers to use. Each slice is cut on `y` axis (so rows are not affected).\nThey a new system process is being created for every slice. In order to process edge pixels, each slice is being padded by edge values of previous and next slice.\nSlices are copies of original image and are stored in each process's memory.\n \nWorkers apply filter on each pixel in the loop. Before processing next iterations the worker synchronizes edge values with its neighbours, so that there is no inconsistency in end result.\n\n## sample benchmark\n### machine\n* Intel Core i7 8th gen 2.2Ghz (max. 4.1Ghz) 6x\n* 32GB DDR4\n* macOS Catalina\n\n### parameters\n```\nMAX_WORKERS=24\nMAX_ITERATIONS=10\n```\n### results\n![image](https://user-images.githubusercontent.com/32958017/72752923-cd76d500-3bc3-11ea-9373-f0a2a66bcaee.png)\n\n## credits\nThe project was made by Jakub Riegel during Software Engineering course on Poznan University of Technology\n\n![put logo](https://www.put.poznan.pl/themes/newputpoznan/images/logo.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubriegel%2Fconvolution_filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakubriegel%2Fconvolution_filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubriegel%2Fconvolution_filter/lists"}